/* Классика Веги: графитовая навигация, бумажные поверхности и медный акцент.
   Печать использует общий контрастный макет портала для обеих тем. */
@media screen {
  html[data-portal-theme="classic"] {
    --vega-dark: #262421;
    --vega-bg: #eae6df;
    --vega-surface: #f4f1eb;
    --vega-panel-soft: #faf8f4;
    --vega-card: #fffefa;
    --vega-row-hover: #f8f4ed;
    --vega-text: #2b2824;
    --vega-muted: #625d56;
    --vega-placeholder: #70675e;
    --vega-hairline: #e9e4dc;
    --vega-border-light: #dbd4c9;
    --vega-border: #a79b8d;
    --vega-accent: #944629;
    --vega-accent-hover: #803b24;
    --vega-on-accent: #fff;
    --vega-link: #884127;
    --vega-coral: #ad5536;
    --vega-coral-deep: #78391f;
    --accent: var(--vega-link);
    --accent-soft: #f6e6d9;
    --accent-tint: #fcf5ed;
    --accent-ink: #673521;
    --vega-selected-ink: var(--accent-ink);
    --vega-selected-surface: var(--accent-soft);
    --focus-color: #a44927;
    --disabled-ink: #676058;
    --disabled-bg: #eae6df;
    --radius-sm: 6px;
    --radius-card: 10px;
    --shadow-card: 0 1px 2px #32231309, 0 3px 10px #32231304;
    --shadow-card-hover: 0 3px 6px #3223130a, 0 7px 20px #32231308;
    --ds-text: var(--vega-text);
    --ds-text-subtle: var(--vega-muted);
    --ds-text-subtlest: var(--vega-placeholder);
    --ds-text-brand: var(--vega-link);
    --ds-text-selected: var(--accent-ink);
    --ds-link: var(--vega-link);
    --ds-link-pressed: var(--vega-coral-deep);
    --ds-icon-brand: var(--vega-coral);
    --ds-icon-selected: var(--accent-ink);
    --ds-border-focused: var(--focus-color);
    --ds-border-selected: var(--vega-coral);
    --ds-background-brand-bold: var(--vega-accent);
    --ds-background-brand-bold-hovered: var(--vega-accent-hover);
    --ds-background-brand-bold-pressed: #6f331e;
    --ds-background-selected: var(--accent-soft);
    --ds-background-selected-hovered: #efd7c4;
    --ds-background-selected-pressed: #e6c0a5;
    --ds-surface: var(--vega-card);
    --ds-surface-sunken: var(--vega-panel-soft);
    --ds-surface-raised: var(--vega-card);
    --ds-surface-overlay: var(--vega-card);
  }

  html[data-portal-theme="classic"] ::selection {
    color: #342318;
    background: #f5ceaf;
  }

  /* Сайдбар сохраняет геометрию и порядок клавиатурной навигации Atlas. */
  html[data-portal-theme="classic"] .sidebar {
    color: #f6f1eb;
    border-color: #292724;
    background: linear-gradient(168deg, #302e2b, var(--vega-dark) 42%, #211f1d);
  }
  html[data-portal-theme="classic"] .brand-panel {
    background: transparent;
    border-color: #ffffff23;
  }
  html[data-portal-theme="classic"] .brand-panel img { filter: brightness(0) invert(1); }
  html[data-portal-theme="classic"] .brand-context { color: #d6c9bb; border-color: #ffffff38; }
  html[data-portal-theme="classic"] .sidebar-nav { scrollbar-color: #71685e transparent; }
  html[data-portal-theme="classic"] .sidebar-nav .nav-section { color: #c0b4a6; }
  html[data-portal-theme="classic"] .sidebar-nav .nav-item { color: #ece6df; border-radius: 6px; }
  html[data-portal-theme="classic"] .sidebar-nav .nav-item svg { color: #c0b6aa; }
  html[data-portal-theme="classic"] .sidebar-nav .nav-item:hover { color: #fff; background: #393631; }
  html[data-portal-theme="classic"] .sidebar-nav .nav-item[aria-current] {
    color: #ffcfaf;
    background: #493931;
    border-color: #73513d;
  }
  html[data-portal-theme="classic"] .sidebar-nav .nav-item[aria-current] svg { color: #ffb18e; }
  html[data-portal-theme="classic"] .sidebar-nav .nav-item[aria-current]::before { background: #ffa580; }
  html[data-portal-theme="classic"] .sidebar-nav .nav-count { color: #f4eae0; background: #4b4640; }
  html[data-portal-theme="classic"] .sidebar-nav [aria-current] .nav-count { color: #ffe3cd; background: #684835; }
  html[data-portal-theme="classic"] .sidebar-close { color: #f6ede4; background: #45413b; }
  html[data-portal-theme="classic"] .sidebar :focus-visible { outline-color: #ffbc94; }

  html[data-portal-theme="classic"] .portal-header .topbar { background: var(--vega-card); }
  html[data-portal-theme="classic"] .global-search input { background: var(--vega-panel-soft); border-color: var(--vega-border-light); }
  html[data-portal-theme="classic"] .portal-crumbs > .atlas-icon { color: #948575; }
  html[data-portal-theme="classic"] .bell { color: #5c534a; }
  html[data-portal-theme="classic"] .bell:hover { color: var(--vega-link); }
  html[data-portal-theme="classic"] :is(.user-avatar, .comment-avatar, .colleague-avatar, .account-avatar-large, .cabinet-avatar, .directory-initial, .employee-card-identity .profile-avatar, .employee-profile-header .profile-avatar, .person-portrait) {
    color: #71472f;
    background-color: #efe4d6;
  }

  /* Фотография рабочего объекта остаётся общей для двух тем. */
  html[data-portal-theme="classic"] .home-hero {
    min-height: 112px;
    border: 1px solid #d9ccbb;
    border-radius: var(--radius-card);
    color: var(--vega-text);
    background: #f1e6d6;
  }
  html[data-portal-theme="classic"] .home-landscape {
    width: 61%;
    filter: saturate(.56) sepia(.24);
  }
  html[data-portal-theme="classic"] .home-hero::before {
    background: linear-gradient(90deg, #f5eddf 0%, #f5eddf 40%, #f5eddfd6 49%, #f5eddf1a 76%);
  }
  html[data-portal-theme="classic"] .home-hero h1 { color: #322b24; }
  html[data-portal-theme="classic"] .home-date {
    gap: 9px;
    color: #655240;
    letter-spacing: .015em;
  }
  html[data-portal-theme="classic"] .home-date::before {
    content: "";
    width: 22px;
    height: 2px;
    background: #b56243;
  }
  html[data-portal-theme="classic"] .hero-primary { color: #fff; background: var(--vega-dark); border-color: var(--vega-dark); }
  html[data-portal-theme="classic"] .hero-primary:hover { color: #fff; background: #40382f; }
  html[data-portal-theme="classic"] .hero-secondary { color: #3c2d22; background: #fffaf1; border-color: #c9b9a4; }
  html[data-portal-theme="classic"] .hero-secondary:hover { color: #442e1d; background: #f6e3cd; }
  html[data-portal-theme="classic"] .home-hero a:focus-visible { outline-color: #412d23; box-shadow: 0 0 0 3px white; }
  html[data-portal-theme="classic"] .workspace-heading h1 {
    font-family: var(--vg-font-display);
    font-weight: 400;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
  }

  /* Поверхности и управляющие элементы рабочих разделов. */
  html[data-portal-theme="classic"] :is(.panel, .panel-header, .home-stat, .employee-filter-panel, .site-card, .search-page-form, .home-sections .my-day) {
    background-color: var(--vega-card);
  }
  html[data-portal-theme="classic"] :is(.panel-header, .data-table thead th, .view-tabs) { border-color: var(--vega-border-light); }
  html[data-portal-theme="classic"] .data-table thead th { color: #615445; background: #f3efe8; }
  html[data-portal-theme="classic"] .home-stat:hover,
  html[data-portal-theme="classic"] .site-card:hover,
  html[data-portal-theme="classic"] .crm-card:hover { border-color: #bda78f; }
  html[data-portal-theme="classic"] :is(.home-panel-icon, .empty-panel-icon, .site-pin, .stat-shifts .stat-icon) {
    color: #835137;
    background: #f2e7d9;
  }
  html[data-portal-theme="classic"] .stat-arrow { color: #8a7c6d; }
  html[data-portal-theme="classic"] .timeline-panel .scroll-hint { background: var(--vega-card); }
  html[data-portal-theme="classic"] .timeline-panel .tl-day.today b { background: var(--vega-accent); }
  html[data-portal-theme="classic"] .tl-cell.today { background: #faf0e5; }
  html[data-portal-theme="classic"] .button.secondary:not(.danger-text, .active, [aria-current], [aria-pressed="true"], :disabled) {
    color: #473a30;
    border-color: #c9bdae;
  }
  html[data-portal-theme="classic"] .button.secondary:not(.danger-text, .active, [aria-current], [aria-pressed="true"], :disabled):hover {
    border-color: #ab9782;
    background: #f7f2eb;
  }
  html[data-portal-theme="classic"] .view-tab { color: var(--vega-muted); }
  html[data-portal-theme="classic"] .view-tab:hover { color: var(--vega-text); background: var(--vega-bg); }
  html[data-portal-theme="classic"] .view-tab:is(.active, [aria-current="page"]) {
    color: var(--vega-selected-ink);
    background: var(--vega-selected-surface);
    border-bottom-color: var(--vega-accent);
  }
  html[data-portal-theme="classic"] :is(.view-switch, .view-tab-count, .site-group-title span) { background: var(--vega-bg); }
  html[data-portal-theme="classic"] .view-switch .button[aria-pressed="true"] {
    color: var(--vega-link);
    border-color: var(--vega-border-light);
    background: var(--vega-card);
    box-shadow: var(--shadow-card);
  }
  html[data-portal-theme="classic"] :is(.chip.active, .hiring-statuses .button.active, .cabinet-queues [aria-current], .queue-disclosure .queue-link.active, .employee-filter-chip) {
    border-color: #d9bca4;
    color: var(--accent-ink);
    background: var(--accent-soft);
  }
  html[data-portal-theme="classic"] .employee-filter-chip:hover { background: var(--ds-background-selected-hovered); }
  html[data-portal-theme="classic"] :is(.form-control, .form-field input:not([type="checkbox"]):not([type="file"]), .form-field select, .form-field textarea, .content-area input[type="file"]):not([aria-invalid="true"]) {
    border-color: var(--vega-border);
  }
  html[data-portal-theme="classic"] :is(.global-search input, .form-control, .form-field input, .form-field select, .form-field textarea):focus:not([aria-invalid="true"]) {
    border-color: var(--vega-accent);
    box-shadow: 0 0 0 3px #ac54331c;
  }
  html[data-portal-theme="classic"] :is(.admin-hint, .picker-option[aria-selected="true"], .picker-option:hover) { border-color: #d9c5ae; }

  /* Карточки, деньги, структура компании и карта сохраняют свою семантику статусов. */
  html[data-portal-theme="classic"] :is(.person-hero, .cabinet-identity, .employee-profile-header) {
    background: linear-gradient(100deg, #f4eadb, var(--vega-card) 72%);
  }
  html[data-portal-theme="classic"] :is(.register-ticket .ticket-reference, .directory-topics li) { color: #625144; background: #eee8df; }
  html[data-portal-theme="classic"] .payment-summary .payment-balance { background: var(--vega-dark); }
  html[data-portal-theme="classic"] :is(.payment-balance span, .payment-balance small, .pay-detail-head .text-link, .pay-detail-sum small, .payment-origin .form-section-header p) { color: #f0d7c0; }
  html[data-portal-theme="classic"] .crm-col { background: #eee9e1; }
  html[data-portal-theme="classic"] .crm-col.drag-over { background: var(--accent-soft); }
  html[data-portal-theme="classic"] .org-viewport { background-image: radial-gradient(#cfc2b2 .8px, transparent .8px); }
  html[data-portal-theme="classic"] .site-atlas { border-color: var(--vega-border-light); }
  html[data-portal-theme="classic"] .status-new,
  html[data-portal-theme="classic"] .status-uploaded { border-color: #dcc5af; }
}

@media screen and (max-width: 640px) {
  html[data-portal-theme="classic"] .home-hero { min-height: 0; }
  html[data-portal-theme="classic"] .home-landscape { width: 100%; }
  html[data-portal-theme="classic"] .home-hero::before {
    background: linear-gradient(90deg, #f5eddf 0%, #f5eddff0 44%, #f5eddf7a 78%, #f5eddf28);
  }
  html[data-portal-theme="classic"] .workspace-heading h1 { font-size: 26px; }
}

@media screen and (forced-colors: active) {
  html[data-portal-theme="classic"] .brand-panel img {
    forced-color-adjust: none;
    background: white;
    filter: none;
  }
}
