/* ===== Simple — lite Glass: те же радиусы/типографика (glass.css), без blur и aurora ===== */
/* Светлая: единая серо-голубая гамма (карточки не «белые острова» на голубом небе). Тёмная: согласованные слои. */

[data-style="simple"] .ambient-bg {
  display: none !important;
}

html[data-style="simple"] {
  --dropzone-radius: 14px;
}

/* ── Светлая: «небо» — одна хрома, разница только в светлости поверхностей ── */
[data-style="simple"][data-theme="light"] {
  --simple-canvas: #e2e9f1;
  --simple-elevated: #ecf1f6;
  --simple-raised: #f4f7fa;
  --simple-control: #e8eef4;
  --simple-stroke: rgba(58, 82, 110, 0.14);
  --simple-shadow: rgba(36, 54, 78, 0.09);
  /* 2 стопа — дешевле многоступенчатого градиента, визуально ровный небесный фон */
  --simple-page-bg: linear-gradient(180deg, #dbe4ee 0%, var(--simple-canvas) 72%);
  --bg: var(--simple-canvas);
  --card-bg: var(--simple-elevated);
  --card-border: var(--simple-stroke);
  --card-shadow: 0 1px 2px var(--simple-shadow), 0 10px 32px var(--simple-shadow);
  --text: #12141a;
  --text-secondary: #525866;
  --text-tertiary: #7a8494;
  --divider: rgba(36, 54, 78, 0.09);
  --row-hover: rgba(36, 54, 78, 0.05);
  --row-alt: rgba(36, 54, 78, 0.028);
  --today-bg: rgba(0, 122, 255, 0.09);
  --dropdown-bg: var(--simple-raised);
  --dropdown-shadow: 0 12px 36px var(--simple-shadow), 0 0 0 1px var(--simple-stroke);
  --auth-modal-shadow: var(--card-shadow), var(--glass-shine);
  --filter-border: rgba(58, 82, 110, 0.16);
  --dashed-border: rgba(58, 82, 110, 0.2);
  --header-icon: #636a78;
  --header-icon-active: #12141a;
  --table-header: #636a78;
  --table-border: rgba(36, 54, 78, 0.07);
  --header-bg: #e9eff5;
  --accent: #007aff;
  --accent-hover: #0066d6;
  --accent-light: rgba(0, 122, 255, 0.12);
  --dropzone-bg: var(--simple-raised);
  --glass-blur: none;
  --glass-shine: inset 0 1px 0 rgba(255, 255, 255, 0.42);
  --mica-bg: var(--simple-elevated);
}

/* ── Тёмная «Звёзды»: canvas < inset (dropzone) < card — светлая: наоборот, raised внутри card ── */
[data-style="simple"][data-theme="dark"] {
  --simple-canvas: #0d1118;
  --simple-elevated: #161c26;
  --simple-raised: #1c2330;
  /* Inset внутри карточки — чуть темнее elevated (как на референсе «Звёзды») */
  --simple-inset: #111820;
  --simple-control: #1a212c;
  --simple-stroke: rgba(148, 168, 198, 0.14);
  --simple-shadow: rgba(0, 0, 0, 0.42);
  --simple-page-bg: radial-gradient(ellipse 110% 85% at 50% -6%, #1a2740 0%, var(--simple-canvas) 58%);
  --bg: var(--simple-canvas);
  --card-bg: var(--simple-elevated);
  --card-border: var(--simple-stroke);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 36px var(--simple-shadow);
  --text: #f2f4f8;
  --text-secondary: #a2a9b8;
  --text-tertiary: #6e7688;
  --divider: rgba(255, 255, 255, 0.08);
  --row-hover: rgba(255, 255, 255, 0.06);
  --row-alt: rgba(255, 255, 255, 0.03);
  --today-bg: rgba(10, 132, 255, 0.16);
  --dropdown-bg: var(--simple-raised);
  --dropdown-shadow: 0 14px 44px var(--simple-shadow), 0 0 0 1px var(--simple-stroke);
  --auth-modal-shadow: var(--card-shadow), var(--glass-shine);
  --filter-border: rgba(148, 168, 198, 0.16);
  --dashed-border: rgba(148, 168, 198, 0.18);
  --header-icon: #989dad;
  --header-icon-active: #fff;
  --table-header: #989dad;
  --table-border: rgba(255, 255, 255, 0.06);
  --header-bg: #141a24;
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --accent-light: rgba(10, 132, 255, 0.22);
  --dropzone-bg: var(--simple-inset);
  --glass-blur: none;
  --glass-shine: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --mica-bg: var(--simple-elevated);
}

[data-style="simple"] body {
  background-color: var(--bg) !important;
  background-image: var(--simple-page-bg) !important;
  background-repeat: no-repeat !important;
  background-size: 100% 100% !important;
  /* scroll: без лишних repaint слоёв от fixed на длинной таблице */
  background-attachment: scroll !important;
}

/*
 * glass.css всё ещё вешает blur на [data-style=simple] у ряда классов (специфичность выше, чем у *).
 * Явно гасим — визуал тот же, т.к. фоны уже непрозрачные.
 */
[data-style="simple"] .catalog-qf-chip,
[data-style="simple"] .cabinet-overlay,
[data-style="simple"] .site-footer,
[data-style="simple"] .search-ranker-seg,
[data-style="simple"] #pd-widget-card .pd-rows,
[data-style="simple"] .admin-callout,
[data-style="simple"] .admin-nav,
[data-style="simple"] .admin-pane,
[data-style="simple"] .admin-stat,
[data-style="simple"] .admin-table,
[data-style="simple"] .api-card,
[data-style="simple"] .verify-card,
[data-style="simple"] .reset-card,
[data-style="simple"] .wl-v1,
[data-style="simple"] .proj-client-card--glass,
[data-style="simple"] .proj-dash-card,
[data-style="simple"] .proj-dash-pane {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

[data-style="simple"] .proj-client-card--glass,
[data-style="simple"] .proj-dash-card,
[data-style="simple"] .proj-dash-pane {
  background: var(--card-bg) !important;
  border-color: var(--card-border) !important;
}

/* Перекрываем полупрозрачные токены glass.css для Simple (только сплошные поверхности) */
[data-style="simple"][data-theme="light"] {
  --row-hover: rgba(36, 54, 78, 0.05) !important;
  --row-alt: rgba(36, 54, 78, 0.028) !important;
}

[data-style="simple"][data-theme="dark"] {
  --row-hover: rgba(255, 255, 255, 0.06) !important;
  --row-alt: rgba(255, 255, 255, 0.03) !important;
}

[data-style="simple"] .header {
  background: transparent !important;
}

[data-style="simple"] .card,
[data-style="simple"] .table-card,
[data-style="simple"] .site-footer,
[data-style="simple"] #pd-widget-card .pd-rows,
[data-style="simple"] .cabinet-panel,
[data-style="simple"] .auth-modal,
[data-style="simple"] .report-modal,
[data-style="simple"] .chart-modal,
[data-style="simple"] .cconfirm-modal,
[data-style="simple"] .verify-card,
[data-style="simple"] .reset-card,
[data-style="simple"] .admin-nav,
[data-style="simple"] .admin-pane,
[data-style="simple"] .admin-stat,
[data-style="simple"] .admin-table,
[data-style="simple"] .api-card,
[data-style="simple"] .admin-callout,
[data-style="simple"] a.card.home-dash-kpi {
  background: var(--card-bg) !important;
  border-color: var(--card-border) !important;
}

[data-style="simple"] .table-card .table-scroll-wrap,
[data-style="simple"] #spec-match-panel .table-scroll-wrap,
[data-style="simple"] .table-card .table-scroll-wrap::-webkit-scrollbar-track,
[data-style="simple"] .table-card .table-scroll-wrap::-webkit-scrollbar-corner,
[data-style="simple"] #spec-match-panel .table-scroll-wrap::-webkit-scrollbar-track,
[data-style="simple"] #spec-match-panel .table-scroll-wrap::-webkit-scrollbar-corner {
  background: var(--card-bg) !important;
}

[data-style="simple"] .data-table thead th {
  background: var(--simple-elevated) !important;
}

[data-style="simple"][data-theme="dark"] .data-table thead th {
  background: var(--simple-elevated) !important;
}

/* Меню и выпадашки — только Glass в glass.css с blur; Simple: непрозрачные поверхности */
[data-style="simple"] .user-menu,
[data-style="simple"] .dd-list,
[data-style="simple"] .proj-modal-dd__panel,
[data-style="simple"] .spec-draft-folder-menu,
[data-style="simple"] .theme-panel,
[data-style="simple"] .notif-dd {
  background: var(--dropdown-bg) !important;
  border-color: var(--card-border) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

[data-style="simple"] .user-menu__header,
[data-style="simple"] .user-menu__item,
[data-style="simple"] .dd-item,
[data-style="simple"] .proj-modal-dd__pick,
[data-style="simple"] .spec-draft-folder-menu__item {
  background-color: var(--dropdown-bg) !important;
}

[data-style="simple"] .user-menu__item:hover,
[data-style="simple"] .dd-item:hover,
[data-style="simple"] .proj-modal-dd__pick:hover,
[data-style="simple"] .spec-draft-folder-menu__item:hover {
  background: var(--row-hover) !important;
}

[data-style="simple"] .user-menu__divider {
  background: var(--card-border) !important;
}

[data-style="simple"] .card,
[data-style="simple"] .table-card,
[data-style="simple"] .auth-modal,
[data-style="simple"] .report-modal,
[data-style="simple"] .chart-modal,
[data-style="simple"] .cconfirm-modal,
[data-style="simple"] .cabinet-panel {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

[data-style="simple"] .search-input,
[data-style="simple"] .filter-btn,
[data-style="simple"] .density-btn,
[data-style="simple"] .sort-price-btn,
[data-style="simple"] .dd-search-input,
[data-style="simple"] .search-ranker-seg,
[data-style="simple"][data-theme="light"] .search-ranker-seg,
[data-style="simple"][data-theme="light"] .search-input,
[data-style="simple"][data-theme="light"] .filter-btn,
[data-style="simple"][data-theme="light"] .density-btn,
[data-style="simple"][data-theme="light"] .sort-price-btn,
[data-style="simple"][data-theme="dark"] .search-input,
[data-style="simple"][data-theme="dark"] .filter-btn,
[data-style="simple"][data-theme="dark"] .density-btn,
[data-style="simple"][data-theme="dark"] .sort-price-btn,
[data-style="simple"][data-theme="light"] .dd-search-input,
[data-style="simple"][data-theme="dark"] .dd-search-input {
  background: var(--simple-control) !important;
  border-color: var(--filter-border) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Затемняющие оверлеи: без blur (фон rgba тот же, меньше GPU при открытых модалках) */
[data-style="simple"] .proj-overlay,
[data-style="simple"] .proj-export-overlay,
[data-style="simple"] .spec-name-modal,
[data-style="simple"] .kp-modal,
[data-style="simple"] #kp-prof-modal.kp-modal,
[data-style="simple"] .auth-overlay,
[data-style="simple"] .spec-capture-overlay,
[data-style="simple"] .save-spec-overlay,
[data-style="simple"] .spec-catalog-refresh-overlay,
[data-style="simple"] .cabinet-overlay {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

[data-style="simple"] .spec-catalog-refresh-overlay {
  background: var(--card-bg) !important;
}

[data-style="simple"] .cabinet-overlay {
  background: rgba(18, 24, 34, 0.42) !important;
}

[data-style="simple"][data-theme="dark"] .cabinet-overlay {
  background: rgba(0, 0, 0, 0.52) !important;
}

[data-style="simple"] .card:hover {
  box-shadow: var(--card-shadow), var(--glass-shine), 0 4px 18px var(--simple-shadow) !important;
}

[data-style="simple"][data-theme="dark"] .card:hover {
  box-shadow: var(--card-shadow), var(--glass-shine), 0 4px 18px rgba(0, 0, 0, 0.38) !important;
}

/* Скроллбары в тон canvas (webkit + firefox через variables.css track) */
[data-style="simple"][data-theme="light"] {
  --scrollbar-thumb: rgba(58, 82, 110, 0.22);
  --scrollbar-thumb-hover: rgba(58, 82, 110, 0.34);
  --scrollbar-track: var(--simple-canvas);
}

[data-style="simple"][data-theme="dark"] {
  --scrollbar-thumb: rgba(180, 195, 220, 0.24);
  --scrollbar-thumb-hover: rgba(180, 195, 220, 0.38);
  --scrollbar-track: var(--simple-canvas);
}

[data-style="simple"] .table-card {
  isolation: auto !important;
}

@media (prefers-reduced-motion: reduce) {
  [data-style="simple"] .cab-glass-bg-btn:hover {
    transform: none !important;
  }
}
