/* Тёмная тема CRM. До отдельного решения она применяется только на компьютерах. */
.theme-toggle {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #68635f;
  display: flex;
  font-weight: 750;
  gap: 11px;
  min-height: 42px;
  padding: 9px 11px;
  text-align: left;
  transition: background .18s, border-color .18s, color .18s;
  width: 100%;
}
.theme-toggle:hover { background: #f8f7f5; color: #24211f; }
.theme-toggle-icon { font-size: 19px; line-height: 1; text-align: center; width: 22px; }
body.sidebar-collapsed .theme-toggle { justify-content: center; padding-left: 8px; padding-right: 8px; }
body.sidebar-collapsed .theme-toggle-icon { width: 24px; }

@media (max-width: 900px) {
  .theme-toggle { display: none; }
}

@media (min-width: 901px) {
  html[data-theme="dark"] {
    color-scheme: dark;
    --navy: #f5f7fa;
    --navy-2: #d9e2eb;
    --blue: #5ba3e6;
    --blue-soft: #233d53;
    --ink: #f5f7fa;
    --muted: #8796a5;
    --line: #2b3e50;
    --paper: #17212b;
    --bg: #0e1621;
    --green: #4db987;
    --green-soft: #17392f;
    --red: #ff6861;
    --red-dark: #9b3332;
    --red-soft: #47292f;
    --purple-soft: #302a49;
    --cyan-soft: #193745;
    --etagi-red-soft: #3f272c;
    --shadow: 0 12px 34px rgba(0, 0, 0, .28);
    background: var(--bg);
    color: var(--ink);
  }

  html[data-theme="dark"] body {
    background: var(--bg);
    color: var(--ink);
  }
  html[data-theme="dark"] .sidebar {
    background: #17212b;
    border-color: #263849;
    box-shadow: 7px 0 28px rgba(0, 0, 0, .2);
    color: var(--ink);
  }
  html[data-theme="dark"] .brand-word b,
  html[data-theme="dark"] .login-brand b { color: #f5f2ef; }
  html[data-theme="dark"] .brand-word small,
  html[data-theme="dark"] .login-brand small { color: #9e9791; }
  html[data-theme="dark"] .nav a { color: #aaa49e; }
  html[data-theme="dark"] .nav a span { color: #928b85; }
  html[data-theme="dark"] .nav a:hover { background: #25221f; color: #fff; }
  html[data-theme="dark"] .nav a.active {
    background: #2b5278;
    border-color: #3d6f9d;
    color: #f5f9fd;
  }
  html[data-theme="dark"] .nav a.active span { color: #74b9f4; }
  html[data-theme="dark"] .sidebar-foot { border-color: #3a3632; }
  html[data-theme="dark"] .agency-pill { color: #d7d2cd; }
  html[data-theme="dark"] .agency-pill small { color: #8e8780; }
  html[data-theme="dark"] .link-button { color: #aaa39c; }
  html[data-theme="dark"] .theme-toggle { border-color: #3f3a36; color: #d6d0ca; }
  html[data-theme="dark"] .theme-toggle:hover { background: #292522; color: #fff; }
  html[data-theme="dark"] .sidebar-collapse {
    background: #24211e;
    border-color: #48423d;
    color: #d9d3cd;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .32);
  }

  html[data-theme="dark"] .topbar {
    background: rgba(23, 33, 43, .96);
    border-color: var(--line);
  }
  html[data-theme="dark"] .topbar h1,
  html[data-theme="dark"] h1,
  html[data-theme="dark"] h2,
  html[data-theme="dark"] h3,
  html[data-theme="dark"] h4,
  html[data-theme="dark"] strong,
  html[data-theme="dark"] b { color: inherit; }
  html[data-theme="dark"] .user-chip:hover { background: #27231f; border-color: #45403b; }
  html[data-theme="dark"] .avatar,
  html[data-theme="dark"] .agent-avatar { background: #412320; border-color: #65302c; color: #ff8179; }
  html[data-theme="dark"] .online-avatar { border-color: #191715; }
  html[data-theme="dark"] .notification-bell,
  html[data-theme="dark"] .tournament-podium-button {
    background: #25221f;
    border-color: #45403b;
    color: #e2ddd8;
  }

  html[data-theme="dark"] .panel,
  html[data-theme="dark"] .metric,
  html[data-theme="dark"] .activity-rating-report,
  html[data-theme="dark"] .report-kpi,
  html[data-theme="dark"] .summary-fact-card,
  html[data-theme="dark"] .structure-card,
  html[data-theme="dark"] .agent-card,
  html[data-theme="dark"] .object-heading,
  html[data-theme="dark"] .form-section {
    background: var(--paper);
    border-color: var(--line);
  }
  html[data-theme="dark"] .panel,
  html[data-theme="dark"] .metric,
  html[data-theme="dark"] .activity-rating-report { box-shadow: var(--shadow); }

  html[data-theme="dark"] input,
  html[data-theme="dark"] select,
  html[data-theme="dark"] textarea,
  html[data-theme="dark"] .search,
  html[data-theme="dark"] .multi-filter-toggle,
  html[data-theme="dark"] .objects-filter-control {
    background: #242f3d;
    border-color: #34495e;
    color: #f1eeeb;
  }
  html[data-theme="dark"] input::placeholder,
  html[data-theme="dark"] textarea::placeholder { color: #6f8294; }
  html[data-theme="dark"] input:focus,
  html[data-theme="dark"] select:focus,
  html[data-theme="dark"] textarea:focus { border-color: #5ba3e6; box-shadow: 0 0 0 3px rgba(91, 163, 230, .18); }
  html[data-theme="dark"] .button.secondary,
  html[data-theme="dark"] .button.light { background: #292623; border-color: #4b4641; color: #eeeae6; }
  html[data-theme="dark"] .calculated-card,
  html[data-theme="dark"] .showing-row,
  html[data-theme="dark"] .type-matrix > div,
  html[data-theme="dark"] .result-count { background: #272421; border-color: #403b37; color: #d7d1cb; }

  html[data-theme="dark"] table { color: #ece8e4; }
  html[data-theme="dark"] th { background: #292622; color: #bcb5af; }
  html[data-theme="dark"] td { border-color: #383430; }
  html[data-theme="dark"] tbody tr:hover { background: #282522; }
  html[data-theme="dark"] td a { color: #ff8077; }
  html[data-theme="dark"] .formula-col,
  html[data-theme="dark"] .total-row td { background: #292622; }
  html[data-theme="dark"] .crm-sheet .sheet-cell { background: #201e1c; }
  html[data-theme="dark"] .crm-sheet tbody tr:hover td { background: #2b2724; }
  html[data-theme="dark"] .crm-sheet .sheet-control { color: #f2efec; }
  html[data-theme="dark"] .crm-sheet .sheet-control:hover { background: #312d29; border-color: #4a4540; }
  html[data-theme="dark"] .crm-sheet .sheet-control:focus { background: #332d29; }
  html[data-theme="dark"] .crm-sheet .sticky-id,
  html[data-theme="dark"] .crm-sheet .sticky-agent,
  html[data-theme="dark"] .crm-sheet .sticky-address,
  html[data-theme="dark"] .crm-sheet .sticky-ad-status,
  html[data-theme="dark"] .crm-sheet .sticky-task,
  html[data-theme="dark"] .crm-sheet .sticky-object-status,
  html[data-theme="dark"] .crm-sheet .sticky-category { background: #201e1c; }
  html[data-theme="dark"] .crm-sheet thead .sticky-id,
  html[data-theme="dark"] .crm-sheet thead .sticky-agent,
  html[data-theme="dark"] .crm-sheet thead .sticky-address,
  html[data-theme="dark"] .crm-sheet thead .sticky-ad-status,
  html[data-theme="dark"] .crm-sheet thead .sticky-task,
  html[data-theme="dark"] .crm-sheet thead .sticky-object-status,
  html[data-theme="dark"] .crm-sheet thead .sticky-category { background: #292622; }
  html[data-theme="dark"] .formula-key i { background: #302c28; border-color: #4b4641; }
  html[data-theme="dark"] .sheet-hint { color: #aaa39d; }
  html[data-theme="dark"] .sheet-hint b { color: #e7e2dd; }
  html[data-theme="dark"] .object-daily-metric,
  html[data-theme="dark"] .avito-agent-tab { background: #24211f; border-color: #45403b; color: #d3cdc7; }
  html[data-theme="dark"] .object-daily-metric:hover,
  html[data-theme="dark"] .object-daily-metric:focus,
  html[data-theme="dark"] .object-daily-metric.is-active,
  html[data-theme="dark"] .avito-agent-tab:hover,
  html[data-theme="dark"] .avito-agent-tab.is-active { background: #312b28; border-color: #8c4540; }
  html[data-theme="dark"] .object-daily-metric strong { color: #e8e3de; }
  html[data-theme="dark"] .sheet-toolbar .objects-filter-control:not(.missing-advertising-button),
  html[data-theme="dark"] .sheet-toolbar .objects-filter-reset {
    background: #282522;
    border-color: #4a4540;
    color: #e8e3de;
  }
  html[data-theme="dark"] .objects-excel-scrollbar {
    background: #252321;
    border-color: #4c4844;
  }
  html[data-theme="dark"] .objects-excel-scrollbar > button,
  html[data-theme="dark"] .objects-excel-scroll-rail { background: #36322f; border-color: #524d48; color: #ddd7d1; }
  html[data-theme="dark"] .objects-excel-scroll-thumb { background: #77706a; border-color: #8f8780; }
  html[data-theme="dark"] .multi-filter-panel { background: #25221f; border-color: #4a4540; box-shadow: 0 16px 40px rgba(0, 0, 0, .4); }
  html[data-theme="dark"] .multi-filter-panel header,
  html[data-theme="dark"] .multi-filter-panel footer { border-color: #403b37; }
  html[data-theme="dark"] .multi-filter-options label:hover { background: #332e2a; }

  html[data-theme="dark"] dialog,
  html[data-theme="dark"] dialog > section,
  html[data-theme="dark"] .notification-popover,
  html[data-theme="dark"] .tournament-popover,
  html[data-theme="dark"] .photo-chat-panel,
  html[data-theme="dark"] .team-chat-view {
    background: #201e1c;
    border-color: #49443f;
    color: #efebe7;
  }
  html[data-theme="dark"] dialog::backdrop { background: rgba(0, 0, 0, .72); }
  html[data-theme="dark"] .notification-popover > header,
  html[data-theme="dark"] .tournament-popover > header,
  html[data-theme="dark"] .photo-chat-head { background: #24211f; border-color: #423d38; }
  html[data-theme="dark"] .notification-item { color: #eae5e0; }
  html[data-theme="dark"] .notification-item:hover { background: #302c28; }
  html[data-theme="dark"] .notification-item.is-unread { background: #3b2422; }
  html[data-theme="dark"] .notification-item span,
  html[data-theme="dark"] .notification-item time { color: #aaa29b; }
  html[data-theme="dark"] .activity-toast { background: #25221f; border-color: #4c4641; color: #eeeae6; }

  html[data-theme="dark"] .calendar-day,
  html[data-theme="dark"] .calendar-today-report,
  html[data-theme="dark"] .calendar-feed,
  html[data-theme="dark"] .schedule-card,
  html[data-theme="dark"] .schedule-cell,
  html[data-theme="dark"] .calendar-event-card { background-color: #211f1c; border-color: #403b37; }
  html[data-theme="dark"] .calendar-day.is-weekend { background-color: #29251f; }
  html[data-theme="dark"] .calendar-day.is-empty { background-color: #181715; }

  html[data-theme="dark"] .summary-monthly-facts .summary-fact-card.is-showing { background: #403914; border-color: #625923; }
  html[data-theme="dark"] .summary-monthly-facts .summary-fact-card.is-deposit { background: #342840; border-color: #514064; }
  html[data-theme="dark"] .summary-monthly-facts .summary-fact-card.is-deal { background: #392449; border-color: #5a3970; }
  html[data-theme="dark"] .summary-monthly-facts .summary-fact-card.is-gross { background: #1c392a; border-color: #2f5943; }
  html[data-theme="dark"] .summary-history-tabs a { background: #2b2825; border-color: #4a4540; color: #d8d2cc; }
  html[data-theme="dark"] .summary-history-tabs a.is-active { background: #efebe7; border-color: #efebe7; color: #24211e; }
  html[data-theme="dark"] .summary-history-list article { background: #272421; border-color: #45403b; }
  html[data-theme="dark"] .summary-history-list article span { color: #b6aea8; }
  html[data-theme="dark"] .donut::after { background: #1e1c1a; }
  html[data-theme="dark"] .bar-row > div { background: #393530; }

  html[data-theme="dark"] .focus-browser-state,
  html[data-theme="dark"] .parser-server-state,
  html[data-theme="dark"] .focus-browser-setup,
  html[data-theme="dark"] .focus-pairing-code,
  html[data-theme="dark"] .parser-server-login,
  html[data-theme="dark"] .focus-card,
  html[data-theme="dark"] .valuation-card { background: #26231f; border-color: #48423d; color: #eeeae6; }
  html[data-theme="dark"] .parser-server-login input { background: #1b1917; border-color: #4b4540; }

  html[data-theme="dark"] .login-page { background: #121110; }
  html[data-theme="dark"] .login-card { background: #1f1d1b; border-color: #413c38; box-shadow: 0 24px 70px rgba(0, 0, 0, .38); }
  html[data-theme="dark"] .login-card label { color: #c4bdb7; }

  /* Telegram Night: единая холодная палитра и контраст всех рабочих полей. */
  html[data-theme="dark"] .main,
  html[data-theme="dark"] .content { background: #0e1621; }
  html[data-theme="dark"] .sidebar,
  html[data-theme="dark"] .topbar { background-color: #17212b; }
  html[data-theme="dark"] .nav a { color: #8fa3b5; }
  html[data-theme="dark"] .nav a span { color: #7f94a7; }
  html[data-theme="dark"] .nav a:hover { background: #202f3d; color: #f5f7fa; }
  html[data-theme="dark"] .sidebar-foot { border-color: #2b3e50; }
  html[data-theme="dark"] .theme-toggle,
  html[data-theme="dark"] .sidebar-collapse,
  html[data-theme="dark"] .notification-bell,
  html[data-theme="dark"] .tournament-podium-button {
    background: #202b36;
    border-color: #30465a;
    color: #dce6ef;
  }
  html[data-theme="dark"] .theme-toggle:hover,
  html[data-theme="dark"] .notification-bell:hover,
  html[data-theme="dark"] .tournament-podium-button:hover { background: #283b4d; border-color: #456b8d; }

  html[data-theme="dark"] .panel,
  html[data-theme="dark"] .metric,
  html[data-theme="dark"] .activity-rating-report,
  html[data-theme="dark"] .report-kpi,
  html[data-theme="dark"] .summary-fact-card,
  html[data-theme="dark"] .structure-card,
  html[data-theme="dark"] .agent-card,
  html[data-theme="dark"] .form-section,
  html[data-theme="dark"] .calendar-today-report,
  html[data-theme="dark"] .calendar-feed,
  html[data-theme="dark"] .calendar-month-panel,
  html[data-theme="dark"] .schedule-card { background: #17212b; border-color: #2b3e50; }

  html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
  html[data-theme="dark"] select,
  html[data-theme="dark"] textarea,
  html[data-theme="dark"] .search,
  html[data-theme="dark"] .multi-filter-toggle,
  html[data-theme="dark"] .objects-filter-control,
  html[data-theme="dark"] .planned-event-editor input,
  html[data-theme="dark"] .planned-event-editor select,
  html[data-theme="dark"] .planned-event-editor textarea,
  html[data-theme="dark"] .calendar-event-dialog input,
  html[data-theme="dark"] .calendar-event-dialog select,
  html[data-theme="dark"] .calendar-event-dialog textarea {
    background-color: #242f3d !important;
    border-color: #34495e !important;
    color: #f5f7fa !important;
  }
  html[data-theme="dark"] input[type="checkbox"],
  html[data-theme="dark"] input[type="radio"] { accent-color: #5ba3e6; }
  html[data-theme="dark"] option { background: #242f3d; color: #f5f7fa; }
  html[data-theme="dark"] input:disabled,
  html[data-theme="dark"] select:disabled,
  html[data-theme="dark"] textarea:disabled { background: #1c2935 !important; color: #7f91a3 !important; opacity: 1; }

  html[data-theme="dark"] .calculated-card,
  html[data-theme="dark"] .showing-row,
  html[data-theme="dark"] .type-matrix > div,
  html[data-theme="dark"] .result-count,
  html[data-theme="dark"] .activity-rating-formula,
  html[data-theme="dark"] .activity-rating-row,
  html[data-theme="dark"] .activity-rating-breakdown > span,
  html[data-theme="dark"] .activity-week-history span,
  html[data-theme="dark"] .tournament-month-table,
  html[data-theme="dark"] .tournament-standing-list article,
  html[data-theme="dark"] .tournament-popover-list article,
  html[data-theme="dark"] .tournament-table-wrap {
    background: #202b36;
    border-color: #304254;
    color: #eaf0f5;
  }
  html[data-theme="dark"] .activity-rating-row.is-leader,
  html[data-theme="dark"] .tournament-standing-list article.is-podium,
  html[data-theme="dark"] .tournament-popover-list article.is-podium,
  html[data-theme="dark"] .tournament-score-table tbody tr.is-podium td { background: #313b38; border-color: #52634e; }
  html[data-theme="dark"] .tournament-month-table > div.is-podium { background: #293846; }

  html[data-theme="dark"] th,
  html[data-theme="dark"] .crm-sheet thead th,
  html[data-theme="dark"] .tournament-score-table th { background: #202b36; color: #91a6b8; border-color: #314456; }
  html[data-theme="dark"] td { border-color: #293b4c; }
  html[data-theme="dark"] tbody tr:hover,
  html[data-theme="dark"] .crm-sheet tbody tr:hover td { background: #1d2d3b; }
  html[data-theme="dark"] .crm-sheet .sheet-cell,
  html[data-theme="dark"] .crm-sheet tbody .sticky-id,
  html[data-theme="dark"] .crm-sheet tbody .sticky-agent,
  html[data-theme="dark"] .crm-sheet tbody .sticky-address,
  html[data-theme="dark"] .crm-sheet tbody .sticky-ad-status,
  html[data-theme="dark"] .crm-sheet tbody .sticky-task,
  html[data-theme="dark"] .crm-sheet tbody .sticky-object-status,
  html[data-theme="dark"] .crm-sheet tbody .sticky-category { background: #17212b; }
  html[data-theme="dark"] .crm-sheet thead .sticky-id,
  html[data-theme="dark"] .crm-sheet thead .sticky-agent,
  html[data-theme="dark"] .crm-sheet thead .sticky-address,
  html[data-theme="dark"] .crm-sheet thead .sticky-ad-status,
  html[data-theme="dark"] .crm-sheet thead .sticky-task,
  html[data-theme="dark"] .crm-sheet thead .sticky-object-status,
  html[data-theme="dark"] .crm-sheet thead .sticky-category,
  html[data-theme="dark"] .formula-col,
  html[data-theme="dark"] .total-row td { background: #202b36; }
  html[data-theme="dark"] .crm-sheet .sheet-control { background: transparent !important; border-color: transparent !important; color: #edf3f8 !important; }
  html[data-theme="dark"] .crm-sheet .sheet-control:hover { background: #243746 !important; border-color: #3c5971 !important; }
  html[data-theme="dark"] .crm-sheet .sheet-control:focus { background: #243746 !important; border-color: #5ba3e6 !important; box-shadow: inset 0 0 0 1px #5ba3e6; }
  html[data-theme="dark"] .crm-sheet .row-deal td,
  html[data-theme="dark"] .crm-sheet .row-deal .sheet-cell { background: #302a49 !important; }
  html[data-theme="dark"] .crm-sheet .row-sold td,
  html[data-theme="dark"] .crm-sheet .row-sold .sheet-cell { background: #193745 !important; }
  html[data-theme="dark"] .crm-sheet .row-refused td,
  html[data-theme="dark"] .crm-sheet .row-refused .sheet-cell { background: #47292f !important; color: #f3e7e8; }
  html[data-theme="dark"] .crm-sheet .metric-today-row:not(.row-deal):not(.row-sold):not(.row-refused) td { background: #17392f; }
  html[data-theme="dark"] .crm-sheet .task-cell.has-task { background: #3f272c; color: #ffaaa5; }
  html[data-theme="dark"] .crm-sheet .task-cell.has-task .sheet-control { color: #ffaaa5 !important; }
  html[data-theme="dark"] .crm-sheet .row-deposit .address-cell { background: #17212b !important; }
  html[data-theme="dark"] .crm-sheet .row-deposit .address-cell-inner { background: #302a49; color: #f0e8fa; }
  html[data-theme="dark"] .crm-sheet tr:not(.row-deal):not(.row-sold):not(.row-refused) .publication-age.age-fresh { background: #17392f !important; color: #91dfba; }
  html[data-theme="dark"] .crm-sheet .deposit-date-missing .object-status-col .sheet-control,
  html[data-theme="dark"] .crm-sheet .deposit-date-missing .object-status-col .sheet-value { background: #47292f !important; color: #ffaaa5 !important; }
  html[data-theme="dark"] .crm-sheet .id-cell.id-advertising-warning { background: #17212b !important; }
  html[data-theme="dark"] .crm-sheet .id-cell.id-advertising-warning .sheet-control,
  html[data-theme="dark"] .crm-sheet .id-cell.id-advertising-warning > a:not(.sheet-open) { background: #6a3438 !important; border-color: #c4524c !important; color: #ffd9d6 !important; }
  html[data-theme="dark"] .crm-sheet .id-cell.id-advertising-warning .sheet-open { color: #ff8179 !important; }
  html[data-theme="dark"] .ad-platform-indicator { background: #263746; border-color: #3b5266; color: #8497a8; }
  html[data-theme="dark"] .category-none { background: #30404f; color: #aebdcc; }

  html[data-theme="dark"] .object-daily-metric,
  html[data-theme="dark"] .avito-agent-tab,
  html[data-theme="dark"] .summary-history-tabs a,
  html[data-theme="dark"] .summary-history-list article,
  html[data-theme="dark"] .calendar-event-metric,
  html[data-theme="dark"] .calendar-month-metrics.is-current {
    background: #202b36;
    border-color: #31475a;
    color: #dce5ed;
  }
  html[data-theme="dark"] .object-daily-metric:hover,
  html[data-theme="dark"] .object-daily-metric.is-active,
  html[data-theme="dark"] .avito-agent-tab:hover,
  html[data-theme="dark"] .avito-agent-tab.is-active { background: #263b4d; border-color: #4b7da6; }
  html[data-theme="dark"] .summary-history-tabs a.is-active { background: #2b5278; border-color: #4d82ae; color: #fff; }

  html[data-theme="dark"] .multi-filter-panel,
  html[data-theme="dark"] .planned-address-results,
  html[data-theme="dark"] .notification-popover,
  html[data-theme="dark"] .tournament-popover,
  html[data-theme="dark"] dialog,
  html[data-theme="dark"] dialog > section,
  html[data-theme="dark"] .photo-chat-panel,
  html[data-theme="dark"] .team-chat-view {
    background: #17212b;
    border-color: #30465a;
    color: #f0f4f8;
  }
  html[data-theme="dark"] .planned-event-editor .planned-address-results button,
  html[data-theme="dark"] .planned-address-results button { background: #202f3d; border-color: #30465a; color: #eef3f7; }
  html[data-theme="dark"] .planned-event-editor .planned-address-results button:hover,
  html[data-theme="dark"] .planned-address-results button:hover { background: #2b5278; }
  html[data-theme="dark"] .notification-popover > header,
  html[data-theme="dark"] .tournament-popover > header,
  html[data-theme="dark"] .photo-chat-head { background: #202b36; border-color: #304254; }
  html[data-theme="dark"] .notification-item:hover { background: #202f3d; }
  html[data-theme="dark"] .notification-item.is-unread { background: #20384d; }

  html[data-theme="dark"] .calendar-month-day,
  html[data-theme="dark"] .calendar-month-day:not(.is-no-events):not(.is-empty),
  html[data-theme="dark"] .calendar-month-day.is-no-events,
  html[data-theme="dark"] .calendar-day,
  html[data-theme="dark"] .calendar-event-card,
  html[data-theme="dark"] .calendar-working-agents .calendar-today-event { background: #17212b; border-color: #2b3e50; }
  html[data-theme="dark"] .calendar-month-day.is-weekend,
  html[data-theme="dark"] .calendar-day.is-weekend { background: #1b2a37; }
  html[data-theme="dark"] .calendar-month-day.is-empty,
  html[data-theme="dark"] .calendar-day.is-empty { background: #111c27; }
  html[data-theme="dark"] .planned-date-field > [data-planned-day-events] { background: #3b351d; border-color: #6f6230; color: #f2e5a7; }

  html[data-theme="dark"] .focus-browser-state,
  html[data-theme="dark"] .parser-server-state,
  html[data-theme="dark"] .focus-browser-setup,
  html[data-theme="dark"] .focus-pairing-code,
  html[data-theme="dark"] .parser-server-login,
  html[data-theme="dark"] .focus-card,
  html[data-theme="dark"] .valuation-card,
  html[data-theme="dark"] .valuation-note { background: #202b36; border-color: #30465a; color: #e9f0f5; }
  html[data-theme="dark"] .parser-server-state.is-ready { background: #17392f; border-color: #275c49; }
  html[data-theme="dark"] .parser-server-login input { background: #242f3d !important; }
  html[data-theme="dark"] .valuation-comparable-table tbody tr:hover td,
  html[data-theme="dark"] .parser-private-table tbody tr:hover td { background: #203345; }
  html[data-theme="dark"] .parser-feed-tabs { border-color: #30465a; }
  html[data-theme="dark"] .parser-feed-tabs button { background: #202b36; border-color: #30465a; color: #b8c7d3; }
  html[data-theme="dark"] .parser-feed-tabs button b { background: #2c3c4c; color: #c8d5df; }
  html[data-theme="dark"] .parser-feed-tabs button.is-active { background: #263746; border-color: #8d504b; color: #ff8f88; }
  html[data-theme="dark"] .parser-private-table-wrap { border-color: #30465a; }
  html[data-theme="dark"] .parser-private-table th { background: #202b36; color: #9fb0be; }
  html[data-theme="dark"] .parser-private-table td { border-color: #304254; color: #dce6ed; }
  html[data-theme="dark"] .parser-listing-address { color: #edf3f8; }
  html[data-theme="dark"] .parser-private-table time,
  html[data-theme="dark"] .parser-cadastral small { color: #9fb0be; }
  html[data-theme="dark"] .parser-author.is-owner { background: #17392f; color: #9de0bd; }
  html[data-theme="dark"] .parser-author.is-agency { background: #263754; color: #b6c8ff; }

  html[data-theme="dark"] .button.secondary,
  html[data-theme="dark"] .button.light,
  html[data-theme="dark"] .sheet-toolbar .objects-filter-control:not(.missing-advertising-button),
  html[data-theme="dark"] .sheet-toolbar .objects-filter-reset { background: #242f3d; border-color: #3a5268; color: #edf3f8; }
  html[data-theme="dark"] .button.secondary:hover,
  html[data-theme="dark"] .button.light:hover { background: #2b5278; border-color: #4c83b0; }
  html[data-theme="dark"] .objects-excel-scrollbar { background: #17212b; border-color: #30465a; }
  html[data-theme="dark"] .objects-excel-scrollbar > button,
  html[data-theme="dark"] .objects-excel-scroll-rail { background: #263746; border-color: #3b5266; color: #dce6ef; }
  html[data-theme="dark"] .objects-excel-scroll-thumb { background: #587087; border-color: #6f879d; }

  html[data-theme="dark"] .summary-monthly-facts .summary-fact-card.is-showing,
  html[data-theme="dark"] .monthly-facts article.is-showing { background: #403b20; border-color: #625a2b; }
  html[data-theme="dark"] .summary-monthly-facts .summary-fact-card.is-deposit,
  html[data-theme="dark"] .monthly-facts article.is-deposit { background: #352d4d; border-color: #51436e; }
  html[data-theme="dark"] .summary-monthly-facts .summary-fact-card.is-deal,
  html[data-theme="dark"] .monthly-facts article.is-deal { background: #3b2956; border-color: #5c3f7c; }
  html[data-theme="dark"] .summary-monthly-facts .summary-fact-card.is-gross { background: #1d3b31; border-color: #2d5a48; }
  html[data-theme="dark"] .donut::after { background: #17212b; }
  html[data-theme="dark"] .bar-row > div { background: #263746; }

  html[data-theme="dark"] .login-page { background: #0e1621; }
  html[data-theme="dark"] .login-card { background: #17212b; border-color: #30465a; }
  html[data-theme="dark"] .login-card label { color: #b5c3cf; }

  /* Telegram Night: остаточные светлые поверхности отдельных разделов. */
  html[data-theme="dark"] .objects-page .missing-advertising-button.is-zero,
  html[data-theme="dark"] .objects-page .objects-new-button {
    background: #242f3d !important;
    border-color: #d34a43 !important;
    color: #ff6b64 !important;
  }
  html[data-theme="dark"] .multi-filter-toggle > b {
    background: #33485d;
    color: #dce7f0;
  }

  html[data-theme="dark"] .calendar-feed-head button,
  html[data-theme="dark"] .calendar-weekday-row,
  html[data-theme="dark"] .calendar-planning-controls,
  html[data-theme="dark"] .calendar-feed-panel {
    background: #17212b;
    border-color: #2b3e50;
    color: #f5f7fa;
  }
  html[data-theme="dark"] .calendar-feed-head > button {
    background: #242f3d !important;
    border-color: #3a5268 !important;
  }
  html[data-theme="dark"] .calendar-feed-head > button:hover { background: #2b5278 !important; border-color: #4c83b0 !important; }
  html[data-theme="dark"] .calendar-filter-bar,
  html[data-theme="dark"] .calendar-sheet-filters {
    background: #17212b !important;
    border-color: #2b3e50 !important;
  }
  html[data-theme="dark"] .calendar-today-columns h3 b {
    background: #33485d;
    color: #f5f7fa;
  }
  html[data-theme="dark"] .calendar-weekday-row span { color: #a8b8c7; }
  html[data-theme="dark"] .calendar-weekday-row span:nth-last-child(-n+2) { color: #ff7770; }
  html[data-theme="dark"] .calendar-month-day > header time { color: #e9f0f5; }
  html[data-theme="dark"] .calendar-month-day > header button,
  html[data-theme="dark"] .calendar-day-add {
    background: #263746;
    border-color: #456279;
    color: #ff716a;
  }
  html[data-theme="dark"] .calendar-feed-event { background: #202b36; border-color: #30465a; color: #edf3f8; }
  html[data-theme="dark"] .calendar-month-event.is-other { background: #3390ec; border-left-color: #2376ca; color: #ffffff; }
  html[data-theme="dark"] .calendar-month-event.is-new_object { background: #203b58; border-left-color: #5ca6f5; color: #c7e2ff; }
  html[data-theme="dark"] .calendar-dialog-card,
  html[data-theme="dark"] .calendar-event-brief,
  html[data-theme="dark"] .calendar-event-brief p,
  html[data-theme="dark"] .calendar-event-manage > details > form,
  html[data-theme="dark"] .calendar-listing-summary,
  html[data-theme="dark"] .calendar-listing-summary [data-calendar-listing-fields] > div,
  html[data-theme="dark"] .event-reminder-card,
  html[data-theme="dark"] .event-reminder-brief,
  html[data-theme="dark"] .event-reminder-actions > details > form,
  html[data-theme="dark"] .planned-confirm-dialog > section {
    background: #17212b;
    border-color: #30465a;
    color: #edf3f8;
  }
  html[data-theme="dark"] .calendar-dialog-card > header > button,
  html[data-theme="dark"] .calendar-event-manage > details > summary,
  html[data-theme="dark"] .event-reminder-actions > .button,
  html[data-theme="dark"] .event-reminder-actions > details > summary {
    background: #242f3d;
    border-color: #3a5268;
    color: #edf3f8;
  }
  html[data-theme="dark"] .calendar-event-readonly { background: #202b36; color: #9eb0bf; }

  html[data-theme="dark"] .schedule-month-nav > a,
  html[data-theme="dark"] .schedule-today-link,
  html[data-theme="dark"] .schedule-total,
  html[data-theme="dark"] .schedule-save-state {
    background: #202b36;
    border-color: #30465a;
    color: #e6eef5;
  }
  html[data-theme="dark"] .schedule-grid th,
  html[data-theme="dark"] .schedule-grid td { border-color: #304254; }
  html[data-theme="dark"] .schedule-cell { background: #17212b; }
  html[data-theme="dark"] .schedule-cell.is-weekend { background: #342f23; }
  html[data-theme="dark"] .schedule-cell select { background: transparent !important; border-color: transparent !important; }
  html[data-theme="dark"] .work-schedule-page .schedule-cell.is-work { background: #214536 !important; }
  html[data-theme="dark"] .work-schedule-page .schedule-cell.is-duty { background: #17613f !important; }
  html[data-theme="dark"] .work-schedule-page .schedule-cell.is-off { background: #5a2d32 !important; }
  html[data-theme="dark"] .work-schedule-page .schedule-cell.is-vacation { background: #23435b !important; }
  html[data-theme="dark"] .work-schedule-page .schedule-cell.is-sick { background: #394653 !important; }
  html[data-theme="dark"] .work-schedule-page .schedule-cell select,
  html[data-theme="dark"] .work-schedule-page .schedule-cell span { color: #eef4f8 !important; }

  html[data-theme="dark"] .object-metric-report,
  html[data-theme="dark"] .photo-bot-report,
  html[data-theme="dark"] .photo-bot-kpis article,
  html[data-theme="dark"] .report-metric-tab,
  html[data-theme="dark"] .object-metric-report-current > span,
  html[data-theme="dark"] .photo-bot-users {
    background: #17212b;
    border-color: #2b3e50;
    color: #eef3f7;
  }
  html[data-theme="dark"] .report-metric-tab { background: #202b36; }
  html[data-theme="dark"] .report-metric-tab:hover { background: #263a4b; border-color: #4d7392; }
  html[data-theme="dark"] .report-metric-tab.is-active { background: #2b5278; border-color: #5b92bf; }
  html[data-theme="dark"] .object-metric-line-chart line { stroke: #304254; }
  html[data-theme="dark"] .object-metric-line-chart circle { fill: #17212b; }
  html[data-theme="dark"] .photo-bot-daily-chart { border-color: #304254; }
  html[data-theme="dark"] .photo-bot-action-track,
  html[data-theme="dark"] .report-financial-track,
  html[data-theme="dark"] .report-type-status-track { background: #293b4c; }
  html[data-theme="dark"] .report-type-donut::after { background: #17212b; }
  html[data-theme="dark"] .report-type-status-values span { background: #202b36; color: #edf3f8; }

  html[data-theme="dark"] .org-level,
  html[data-theme="dark"] .org-tier,
  html[data-theme="dark"] .org-person,
  html[data-theme="dark"] .org-tier .org-person,
  html[data-theme="dark"] .invite-dialog-card,
  html[data-theme="dark"] .terminate-menu > form {
    background: #17212b;
    border-color: #30465a;
    color: #f0f4f8;
  }
  html[data-theme="dark"] .org-tier-heading .org-tier-icon,
  html[data-theme="dark"] .org-level > header > span { background: #263746; }
  html[data-theme="dark"] .terminate-menu > form button,
  html[data-theme="dark"] .suggestion-delete-form button,
  html[data-theme="dark"] .button.danger { background: #242f3d; border-color: #b95a54; color: #ff8d86; }
  html[data-theme="dark"] .terminate-menu > form button:hover,
  html[data-theme="dark"] .suggestion-delete-form button:hover,
  html[data-theme="dark"] .button.danger:hover { background: #9b3332; border-color: #d85a53; color: #fff; }
  html[data-theme="dark"] .admin-protected-note,
  html[data-theme="dark"] .advertising-summary,
  html[data-theme="dark"] .avito-api-state {
    background: #202b36;
    border-color: #304254;
    color: #b9c8d5;
  }
  html[data-theme="dark"] .avito-api-state.is-connected { background: #17392f; color: #8cdbb7; }
  html[data-theme="dark"] .avito-api-state.is-error { background: #47292f; color: #ff9993; }
  html[data-theme="dark"] .cian-api-state { background: #193745; color: #8fc9ff; }
  html[data-theme="dark"] .avito-api-state small { background: #263746; color: #cbd7e1; }

  html[data-theme="dark"] .ad-agent-group,
  html[data-theme="dark"] .ad-agent-group > header,
  html[data-theme="dark"] .ad-agent-column li { background: #202b36; border-color: #304254; }
  html[data-theme="dark"] .ad-agent-column + .ad-agent-column { border-color: #304254; }

  html[data-theme="dark"] .parser-valuation-list > article { background: #202b36; border-color: #30465a; color: #edf3f8; }
  html[data-theme="dark"] .valuation-status.is-completed { background: #214536; color: #9de0bd; }
  html[data-theme="dark"] .valuation-status.is-error,
  html[data-theme="dark"] .valuation-status.is-blocked { background: #47292f; color: #ffaaa5; }

  html[data-theme="dark"] .suggestion-upload,
  html[data-theme="dark"] .suggestion-ticket,
  html[data-theme="dark"] .suggestion-ticket-new,
  html[data-theme="dark"] .suggestion-chat,
  html[data-theme="dark"] .suggestion-chat > header,
  html[data-theme="dark"] .suggestion-chat-message > div { background: #202b36; border-color: #304254; color: #edf3f8; }
  html[data-theme="dark"] .suggestion-chat-message.is-mine > div { background: #233d53; }
  html[data-theme="dark"] .suggestion-upload-icon,
  html[data-theme="dark"] .suggestion-author-avatar,
  html[data-theme="dark"] .suggestion-chat-avatar { background: #30465a; color: #dce7f0; }
  html[data-theme="dark"] .suggestion-ticket-new { border-left-color: #ff6861; }

  html[data-theme="dark"] .admin-edit-form { background: #202b36; border-color: #304254; }
  html[data-theme="dark"] .admin-danger-zone { background: #35252b; border-color: #59343a; }
  html[data-theme="dark"] .admin-danger-zone b { color: #ffaaa5; }
  html[data-theme="dark"] .admin-danger-zone small { color: #bfaeb0; }

  html[data-theme="dark"] .team-chat-directory,
  html[data-theme="dark"] .team-chat-pinned-list,
  html[data-theme="dark"] .team-chat-private-list,
  html[data-theme="dark"] .team-chat-directory-item,
  html[data-theme="dark"] .team-chat-message-list,
  html[data-theme="dark"] .team-chat-bubble,
  html[data-theme="dark"] .team-chat-compose,
  html[data-theme="dark"] .team-chat-readonly,
  html[data-theme="dark"] .photo-chat-foot,
  html[data-theme="dark"] .photo-message.assistant,
  html[data-theme="dark"] .team-chat-message-actions,
  html[data-theme="dark"] .team-chat-message-actions button {
    background: #17212b;
    border-color: #304254;
    color: #edf3f8;
  }
  html[data-theme="dark"] .team-chat-directory { background: #111c27; }
  html[data-theme="dark"] .team-chat-directory-item:hover,
  html[data-theme="dark"] .team-chat-directory-item.is-active,
  html[data-theme="dark"] .team-chat-message-actions button:hover { background: #263b4d; }
  html[data-theme="dark"] .team-chat-message-list { background: #0e1621; }
  html[data-theme="dark"] .team-chat-bubble { background: #202b36; }
  html[data-theme="dark"] .team-chat-bubble.is-mine { background: #2b5278; }
  html[data-theme="dark"] .team-chat-attach { background: #263746; border-color: #3b5266; color: #dce7f0; }
  html[data-theme="dark"] .notification-popover > header > button,
  html[data-theme="dark"] .tournament-popover > header > button { background: #263746; color: #dce7f0; }

  html[data-theme="dark"] .lifead-chat-instructions > section {
    background: #111c27;
    border-color: #304254;
  }
  html[data-theme="dark"] .lifead-chat-note {
    background: #342f22;
    border-color: #574d2e;
    color: #e4d49b;
  }

  html[data-theme="dark"] .avito-map-canvas { background: #101a24; }
  html[data-theme="dark"] .avito-map-empty,
  html[data-theme="dark"] .leaflet-popup-content-wrapper,
  html[data-theme="dark"] .leaflet-popup-tip {
    background: #17212b;
    border-color: #30465a;
    color: #edf3f8;
  }
  html[data-theme="dark"] .avito-map-empty span { color: #93a5b5; }
  html[data-theme="dark"] .avito-map-stats > span,
  html[data-theme="dark"] .avito-map-search,
  html[data-theme="dark"] .avito-map-listing { background: #202b36; border-color: #30465a; color: #edf3f8; }
  html[data-theme="dark"] .avito-map-listing:hover,
  html[data-theme="dark"] .avito-map-listing:focus { background: #263b4d; border-color: #4b7da6; }
  html[data-theme="dark"] .avito-map-listing > small { color: #9eb0bf; }
  html[data-theme="dark"] .avito-map-page .leaflet-control-zoom a,
  html[data-theme="dark"] .avito-map-page .leaflet-control-attribution {
    background: rgba(23, 33, 43, .94);
    border-color: #30465a;
    color: #dce7f0;
  }
  html[data-theme="dark"] .avito-map-page .leaflet-control-attribution a { color: #70b7ef; }
  html[data-theme="dark"] .monthly-plan-bell-progress,
  html[data-theme="dark"] .agent-plan-progress,
  html[data-theme="dark"] .agent-plan-average { background: #263b4d; color: #70b7ef; }
  html[data-theme="dark"] .plans-overall-ring,
  html[data-theme="dark"] .plan-metric-card,
  html[data-theme="dark"] .plans-table td:first-child,
  html[data-theme="dark"] .agent-plan-popover { background: #17212b; border-color: #304254; color: #edf3f8; }
  html[data-theme="dark"] .plan-metric-card input,
  html[data-theme="dark"] .agent-plan-popover-list > div { background: #202b36; border-color: #304254; color: #edf3f8; }
  html[data-theme="dark"] .plan-metric-card.is-shortfall { background: #392327; border-color: #7d3b41; }
  html[data-theme="dark"] .plans-table tfoot td { background: #202b36; color: #edf3f8; }
}
