/* enhance.css — слой улучшений (волна 1) */
body.light-theme { --bg:#eef1f6; --surface:#ffffff; --surface2:#eef1f7; --border:#d9dee9; --text:#1a1d29; --text-muted:#5c6377; }
.enh-tools { display:inline-flex; gap:6px; margin-right:8px; }
.enh-btn { background:var(--surface2); border:1px solid var(--border); color:var(--text); border-radius:8px; padding:6px 10px; font-size:13px; cursor:pointer; transition:background .15s, transform .1s; }
.enh-btn:hover { background:var(--accent); color:#fff; }
.enh-btn:active { transform:scale(0.96); }
.stat-num { transition:color .2s; }
.enh-pal-ov { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:12000; align-items:flex-start; justify-content:center; }
.enh-pal { margin-top:12vh; width:560px; max-width:92vw; background:var(--surface2); border:1px solid var(--border); border-radius:12px; box-shadow:0 20px 60px rgba(0,0,0,0.6); overflow:hidden; }
.enh-pal-inp { width:100%; box-sizing:border-box; padding:16px 18px; background:transparent; border:none; border-bottom:1px solid var(--border); color:var(--text); font-size:16px; outline:none; }
.enh-pal-list { max-height:50vh; overflow-y:auto; }
.enh-pal-item { padding:10px 18px; font-size:14px; color:var(--text); cursor:pointer; }
.enh-pal-item:hover, .enh-pal-item:first-child { background:rgba(91,106,240,0.18); }
.enh-pal-empty { padding:16px 18px; color:var(--text-muted); }
.enh-ov { max-width:980px; width:96vw; }
.enh-ov-body { max-height:78vh; overflow-y:auto; padding:16px 20px; }
.enh-kpi-row { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.enh-kpi { flex:1; min-width:200px; background:var(--surface2); border:1px solid var(--border); border-radius:12px; padding:14px 16px; }
.enh-kpi-name { font-size:12px; color:var(--text-muted); }
.enh-kpi-total { font-size:30px; font-weight:700; color:var(--text); line-height:1.1; }
.enh-kpi-sub { font-size:13px; margin-top:4px; }
.kpi-g { color:var(--growth); } .kpi-d { color:var(--drop); } .kpi-f { color:var(--flat); } .kpi-o { color:var(--overtime); }
.enh-sec-title { font-size:14px; font-weight:600; margin:18px 0 8px; color:var(--text); }
.enh-insights { display:flex; flex-direction:column; gap:6px; }
.enh-ins { background:var(--surface2); border:1px solid var(--border); border-radius:8px; padding:8px 12px; font-size:13px; }
.enh-two { display:flex; gap:18px; flex-wrap:wrap; }
.enh-two > div { flex:1; min-width:240px; font-size:13px; line-height:1.9; }
.enh-lb { width:100%; border-collapse:collapse; font-size:13px; }
.enh-lb th, .enh-lb td { text-align:left; padding:6px 8px; border-bottom:1px solid var(--border); }
.enh-lb th { color:var(--text-muted); font-weight:600; }
.enh-pres { display:none; position:fixed; inset:0; z-index:13000; background:radial-gradient(circle at 50% 30%, #16203a, #0b0e16); flex-direction:column; align-items:center; justify-content:center; gap:28px; color:#fff; }
.enh-pres-close { position:absolute; top:22px; right:28px; cursor:pointer; color:#9aa3c0; font-size:16px; }
.enh-pres-title { font-size:34px; font-weight:700; }
.enh-pres-kpi { display:flex; gap:28px; flex-wrap:wrap; justify-content:center; }
.pres-card { width:200px; padding:28px; border-radius:20px; text-align:center; font-size:18px; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1); }
.pres-n { font-size:64px; font-weight:800; line-height:1; margin-bottom:8px; }
.pres-g .pres-n { color:#2ecc71; } .pres-d .pres-n { color:#ff4d6d; } .pres-f .pres-n { color:#f5a623; } .pres-o .pres-n { color:#e67e22; }
.enh-pres-list { font-size:18px; line-height:1.9; text-align:center; max-height:30vh; overflow-y:auto; }
.enh-pres-sub { color:#9aa3c0; margin-bottom:6px; }
.stat-card.enh-pulse { animation: enhPulse .7s ease; }
@keyframes enhPulse { 0%{ transform:scale(1); box-shadow:0 0 0 0 rgba(91,106,240,0); } 30%{ transform:scale(1.06); box-shadow:0 0 0 4px rgba(91,106,240,0.25); } 100%{ transform:scale(1); box-shadow:0 0 0 0 rgba(91,106,240,0); } }


/* ===== Волна 2: избранное / теги / цели / подсветка ===== */
.enh-fav { cursor:pointer; margin-right:6px; color:#7a7f9a; font-size:14px; user-select:none; }
.enh-fav.on { color:#ffd54f; }
.enh-fav:hover { color:#ffd54f; }
.enh-meta { display:flex; flex-wrap:wrap; gap:4px; align-items:center; margin-top:3px; }
.enh-tag { font-size:10px; background:rgba(91,106,240,0.18); color:#aab4ff; border:1px solid rgba(91,106,240,0.4); border-radius:4px; padding:1px 6px; }
.enh-goal { font-size:10px; background:rgba(245,166,35,0.15); color:#f5c463; border:1px solid rgba(245,166,35,0.4); border-radius:4px; padding:1px 6px; }
.enh-goal.reached { background:rgba(46,204,113,0.18); color:#7be0a3; border-color:rgba(46,204,113,0.5); }
.enh-meta-edit { background:rgba(255,255,255,0.10); border:1px solid rgba(255,255,255,0.22); color:#e8eaf0; cursor:pointer; opacity:1; font-size:10px; padding:2px 8px; border-radius:5px; }
.enh-meta-edit:hover { background:var(--accent); color:#fff; border-color:var(--accent); }
.enh-meta-edit:hover { opacity:1; }
.enh-meta-pop { position:fixed; z-index:12500; width:250px; background:var(--surface2); border:1px solid var(--border); border-radius:10px; box-shadow:0 14px 40px rgba(0,0,0,0.5); padding:12px; }
.emp-title { font-size:12px; color:var(--text-muted); margin-bottom:8px; word-break:break-all; }
.emp-row { display:flex; flex-direction:column; gap:3px; margin-bottom:8px; }
.emp-row label { font-size:11px; color:var(--text-muted); }
.emp-row input { background:var(--surface); border:1px solid var(--border); color:var(--text); border-radius:6px; padding:6px 8px; font-size:13px; }
.emp-btns { display:flex; gap:8px; }
.emp-save { flex:1; background:var(--accent); color:#fff; border:none; border-radius:6px; padding:6px; cursor:pointer; }
.emp-cancel { flex:1; background:var(--surface); color:var(--text); border:1px solid var(--border); border-radius:6px; padding:6px; cursor:pointer; }
.slice-cell.enh-flash { animation: enhFlash 2s ease; }
@keyframes enhFlash { 0%{ box-shadow:inset 0 0 0 2px rgba(91,106,240,0.9); background:rgba(91,106,240,0.22); } 100%{ box-shadow:none; background:transparent; } }


/* ===== Волна 3: массовые действия + пресеты ===== */
.enh-bulk-cb { margin-right:8px; vertical-align:middle; cursor:pointer; width:16px; height:16px; accent-color: var(--accent); }
.enh-bulk-bar { position:fixed; bottom:18px; left:50%; transform:translateX(-50%); background:var(--surface2); border:1px solid var(--border); border-radius:12px; box-shadow:0 14px 44px rgba(0,0,0,0.55); padding:10px 14px; display:flex; gap:10px; align-items:center; z-index:11500; }
.enh-bulk-n { color:var(--text); font-weight:600; font-size:13px; margin-right:4px; }
.enh-bulk-btn { background:var(--accent); color:#fff; border:none; border-radius:8px; padding:7px 12px; cursor:pointer; font-size:13px; }
.enh-bulk-btn:hover { filter:brightness(1.1); }
.enh-bulk-x { background:transparent; color:var(--text-muted); border:1px solid var(--border); border-radius:8px; padding:7px 10px; cursor:pointer; font-size:13px; }
.enh-bulk-x:hover { color:var(--text); }
.enh-pre-menu { position:fixed; z-index:12500; width:240px; background:var(--surface2); border:1px solid var(--border); border-radius:10px; box-shadow:0 14px 40px rgba(0,0,0,0.5); padding:6px; }
.enh-pre-item { display:flex; justify-content:space-between; align-items:center; padding:8px 10px; border-radius:6px; cursor:pointer; font-size:13px; color:var(--text); }
.enh-pre-item:hover { background:rgba(91,106,240,0.18); }
.enh-pre-del { color:var(--text-muted); padding:0 4px; }
.enh-pre-del:hover { color:var(--drop); }
.enh-pre-empty { padding:10px; color:var(--text-muted); font-size:12px; }
.enh-pre-save { margin-top:4px; padding:8px 10px; border-top:1px solid var(--border); color:var(--accent); cursor:pointer; font-size:13px; }
.enh-pre-save:hover { background:rgba(91,106,240,0.12); }

/* диалог массовых действий */
.enh-dlg-ov { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:12800; align-items:flex-start; justify-content:center; }
.enh-dlg { margin-top:16vh; width:480px; max-width:92vw; background:var(--surface2); border:1px solid var(--border); border-radius:12px; box-shadow:0 18px 50px rgba(0,0,0,0.6); padding:18px; }
.enh-dlg-title { font-size:14px; font-weight:600; color:var(--text); margin-bottom:10px; }
.enh-dlg-ta { width:100%; box-sizing:border-box; background:var(--surface); border:1px solid var(--border); color:var(--text); border-radius:8px; padding:10px; font-size:14px; resize:vertical; }
.enh-dlg-btns { display:flex; justify-content:flex-end; gap:8px; margin-top:12px; }
.enh-dlg-ok { background:var(--accent); color:#fff; border:none; border-radius:8px; padding:8px 16px; cursor:pointer; }
.enh-dlg-cancel { background:var(--surface); color:var(--text); border:1px solid var(--border); border-radius:8px; padding:8px 16px; cursor:pointer; }

/* режим выбора строк */
.enh-btn.on { background: var(--accent); color:#fff; }
body.enh-selmode #tableBody tr[data-site] { cursor: pointer; }
body.enh-selmode #tableBody tr[data-site]:hover { background: rgba(91,106,240,0.07); }
#tableBody tr.enh-row-sel { box-shadow: inset 3px 0 0 var(--accent); background: rgba(91,106,240,0.13) !important; }
