*{box-sizing:border-box;margin:0;padding:0}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;font-size:14px;background:#f4f6f9;color:#1a1d23;overflow:hidden;height:100vh}
:root{--sb:260px;--sbc:60px}
.sb{width:var(--sb);background:#fff;border-right:1px solid #e5e7eb;display:flex;flex-direction:column;height:100vh;position:fixed;left:0;top:0;z-index:100;transition:width .2s}
.sb.col{width:var(--sbc)}
.sbh{padding:.9rem .75rem;border-bottom:1px solid #f3f4f6;display:flex;align-items:center;gap:9px;height:58px}
.sbl{width:34px;height:34px;background:linear-gradient(135deg,#2563eb,#1d4ed8);border-radius:9px;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:15px;flex-shrink:0}
.sbn{font-size:15px;font-weight:700;white-space:nowrap;transition:opacity .15s;overflow:hidden}
.sb.col .sbn{opacity:0;width:0}
.sb.col~.main .topbar{padding-left:2.5rem}
.sbt{margin-left:auto;width:26px;height:26px;border:none;background:transparent;cursor:pointer;border-radius:6px;color:#9ca3af;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.sbt:hover{background:#f3f4f6;color:#374151}
.sbnav{flex:1;overflow-y:auto;overflow-x:hidden;padding:.375rem 0}
.sbsec{padding:.625rem .875rem .25rem;font-size:10px;font-weight:700;color:#9ca3af;text-transform:uppercase;letter-spacing:.08em;white-space:nowrap;transition:opacity .15s}
.sb.col .sbsec{opacity:0}
.ni{display:flex;align-items:center;gap:9px;padding:8px 10px;margin:1px 6px;border-radius:8px;cursor:pointer;color:#4b5563;font-size:13px;font-weight:500;transition:all .15s;white-space:nowrap;position:relative}
.ni:hover{background:#f3f4f6;color:#111827}
.ni.on{background:#eff6ff;color:#2563eb;font-weight:600}
.ni svg{flex-shrink:0;width:18px;height:18px}
.ni .nl{overflow:hidden;transition:opacity .15s;max-width:200px}
.sb.col .ni .nl{opacity:0;max-width:0}
.nb{margin-left:auto;padding:2px 7px;border-radius:10px;font-size:10px;font-weight:700;background:#dbeafe;color:#2563eb;white-space:nowrap}
.sb.col .nb{display:none}
.sb.col .ni:hover::after{content:attr(data-tip);position:absolute;left:calc(var(--sbc) + 4px);top:50%;transform:translateY(-50%);background:#1f2937;color:#fff;padding:5px 10px;border-radius:7px;font-size:12px;white-space:nowrap;pointer-events:none;z-index:300;box-shadow:0 4px 12px rgba(0,0,0,.2)}
.main{margin-left:var(--sb);height:100vh;display:flex;flex-direction:column;transition:margin-left .2s}
.sb.col~.main{margin-left:var(--sbc)}
.topbar{height:58px;background:#fff;border-bottom:1px solid #e5e7eb;display:flex;align-items:center;padding:0 1.25rem;gap:.75rem;flex-shrink:0}
.tbtitle{font-size:16px;font-weight:700;color:#111827}
.tbright{margin-left:auto;display:flex;align-items:center;gap:.5rem}
.tbtn{display:flex;align-items:center;gap:6px;padding:7px 13px;border:1px solid #e5e7eb;border-radius:8px;background:#fff;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;color:#374151;transition:all .15s}
.tbtn:hover{background:#f9fafb}
.tbtn.g{background:#059669;color:#fff;border-color:#059669}
.tbtn.g:hover{background:#047857}
.content{flex:1;overflow:hidden;width:100%;height:100%}
iframe{width:100%;height:100%;border:none;display:block}
.stub{display:flex;align-items:center;justify-content:center;height:100%;padding:2rem;text-align:center}
.stubw{max-width:480px}
.stubi{font-size:52px;margin-bottom:1.25rem}
.stubt{font-size:22px;font-weight:800;color:#111827;margin-bottom:.5rem}
.stubd{font-size:14px;color:#6b7280;line-height:1.7;margin-bottom:1.5rem}
.stubst{text-align:left;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:1.25rem 1.5rem;margin-bottom:1.5rem}
.stubst h4{font-size:10px;font-weight:700;color:#9ca3af;text-transform:uppercase;letter-spacing:.06em;margin-bottom:.75rem}
.stubl{display:flex;gap:.75rem;padding:.5rem 0;border-bottom:1px solid #f3f4f6;font-size:13px;color:#374151}
.stubl:last-child{border-bottom:none}
.stubln{width:22px;height:22px;border-radius:50%;background:#dbeafe;color:#2563eb;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:1px}
.stubtags{display:flex;gap:.5rem;flex-wrap:wrap;justify-content:center}
.stubtag{padding:5px 12px;border-radius:20px;font-size:12px;font-weight:600;background:#dbeafe;color:#1d4ed8}
.stubtag.g{background:#f3f4f6;color:#6b7280}
/* Shop Switcher */
.shop-switcher{position:relative;margin-left:16px}
.shop-sw-btn{display:flex;align-items:center;gap:8px;padding:5px 12px;border:1px solid #e5e7eb;border-radius:8px;background:#fff;cursor:pointer;font-size:13px;font-weight:500;color:#374151;transition:all .15s;font-family:inherit;white-space:nowrap}
.shop-sw-btn:hover{background:#f9fafb;border-color:#d1d5db}
.shop-sw-btn .sw-mp{width:20px;height:20px;border-radius:5px;display:flex;align-items:center;justify-content:center;font-size:11px;flex-shrink:0}
.shop-sw-btn .sw-mp.wb{background:#f3e8ff;color:#7c3aed}
.shop-sw-btn .sw-mp.oz{background:#dbeafe;color:#2563eb}
.shop-sw-btn .sw-arrow{color:#9ca3af;transition:transform .15s}
.shop-sw-btn.open .sw-arrow{transform:rotate(180deg)}
.shop-sw-dd{position:absolute;top:calc(100% + 4px);left:0;min-width:240px;background:#fff;border:1px solid #e5e7eb;border-radius:10px;box-shadow:0 8px 30px rgba(0,0,0,.12);z-index:200;padding:4px;display:none}
.shop-sw-dd.show{display:block}
.shop-sw-item{display:flex;align-items:center;gap:10px;padding:8px 12px;border-radius:8px;cursor:pointer;font-size:13px;color:#374151;transition:background .1s}
.shop-sw-item:hover{background:#f3f4f6}
.shop-sw-item.active{background:#eff6ff;color:#2563eb;font-weight:600}
.shop-sw-item .sw-mp{width:22px;height:22px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:12px;flex-shrink:0}
.shop-sw-item .sw-check{margin-left:auto;color:#2563eb;display:none}
.shop-sw-item.active .sw-check{display:block}
.shop-sw-sep{height:1px;background:#f3f4f6;margin:4px 8px}
.swrap{height:100%;overflow-y:auto;padding:1.5rem}
.sgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:1rem;max-width:900px}
.scard{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:1.25rem}
.scardh{display:flex;align-items:center;gap:10px;margin-bottom:1rem}
.slabel{font-size:11px;font-weight:600;color:#6b7280;margin-bottom:4px;display:block}
.sinput{width:100%;padding:9px 12px;border:1.5px solid #e5e7eb;border-radius:8px;font-size:13px;font-family:inherit;margin-bottom:.75rem;transition:border-color .15s}
.sinput:focus{outline:none;border-color:#2563eb}
.sbtn{padding:8px 16px;background:#2563eb;color:#fff;border:none;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit}
.sbtn:hover{background:#1d4ed8}
.swarn{background:#fffbeb;border:1px solid #fde68a;border-radius:8px;padding:.75rem 1rem;font-size:12px;color:#92400e;line-height:1.6;margin-top:.75rem}
.sstatus{font-size:12px;margin-top:.5rem;display:none;color:#16a34a}
/* Settings tabs */
.stabs{display:flex;gap:0;border-bottom:2px solid #e5e7eb;margin-bottom:1.5rem}
.stab{padding:10px 20px;font-size:13px;font-weight:600;color:#6b7280;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-2px;transition:all .15s;white-space:nowrap}
.stab:hover{color:#111827}
.stab.on{color:#2563eb;border-bottom-color:#2563eb}
.stpanel{display:none}
.stpanel.on{display:block}
/* Settings form elements */
.sf-row{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-bottom:.75rem}
.sf-row.w1{grid-template-columns:1fr}
.sf-select{width:100%;padding:9px 12px;border:1.5px solid #e5e7eb;border-radius:8px;font-size:13px;font-family:inherit;background:#fff;transition:border-color .15s}
.sf-select:focus{outline:none;border-color:#2563eb}
.sf-hint{font-size:11px;color:#9ca3af;margin-top:2px}
.sf-saved{display:inline-block;font-size:12px;color:#16a34a;margin-left:8px;opacity:0;transition:opacity .3s}
.sf-saved.show{opacity:1}
/* Shop list */
.shop-row{display:flex;align-items:center;padding:14px 16px;border:1px solid #e5e7eb;border-radius:10px;margin-bottom:8px;background:#fff;gap:12px;transition:box-shadow .15s}
.shop-row:hover{box-shadow:0 2px 8px rgba(0,0,0,.06)}
.shop-mp{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:15px;flex-shrink:0}
.shop-mp.wb{background:#CB11AB18}
.shop-mp.oz{background:#0069FF18}
.shop-info{flex:1;min-width:0}
.shop-name{font-size:14px;font-weight:600;color:#111827}
.shop-sub{font-size:12px;color:#9ca3af;margin-top:2px}
.shop-date{font-size:12px;color:#9ca3af;white-space:nowrap;margin-right:12px}
.shop-badge{padding:4px 10px;border-radius:6px;font-size:11px;font-weight:600;white-space:nowrap;margin-right:8px}
.shop-badge.ok{background:#dcfce7;color:#16a34a}
.shop-badge.no{background:#fef2f2;color:#dc2626}
.shop-btn{padding:6px 14px;border:1px solid #e5e7eb;border-radius:7px;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;background:#fff;color:#374151;transition:all .15s;white-space:nowrap}
.shop-btn:hover{background:#f3f4f6}
.shop-btn.del{color:#dc2626;border-color:#fecaca}
.shop-btn.del:hover{background:#fef2f2}
/* Tax grid */
.tax-qcard{background:#fff;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden}
.tax-qhead{display:grid;grid-template-columns:1fr 80px 80px;align-items:center;background:#f9fafb;border-bottom:1px solid #e5e7eb;padding:8px 14px;gap:8px}
.tax-qname{font-size:13px;font-weight:700;color:#111827}
.tax-qcol{font-size:11px;font-weight:700;color:#6b7280;text-align:center}
.tax-row{display:grid;grid-template-columns:1fr 80px 80px;align-items:center;padding:7px 14px;gap:8px;border-bottom:1px solid #f3f4f6}
.tax-row:last-child{border-bottom:none}
.tax-row.quarter-row{background:#f9fafb}
.tax-month{font-size:13px;color:#374151}
.tax-inp{width:100%;border:1.5px solid #e5e7eb;border-radius:6px;padding:5px 8px;font-size:13px;font-family:inherit;text-align:center;transition:border-color .15s}
.tax-inp:focus{outline:none;border-color:#2563eb}
/* Login screen */
.login-screen{position:fixed;inset:0;background:#f4f6f9;z-index:1000;display:flex;align-items:center;justify-content:center}
.login-box{background:#fff;border-radius:16px;padding:2.5rem;width:400px;max-width:92vw;box-shadow:0 8px 40px rgba(0,0,0,.1)}
.login-logo{width:48px;height:48px;background:linear-gradient(135deg,#2563eb,#1d4ed8);border-radius:12px;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:22px;margin:0 auto 1.25rem}
.login-title{font-size:22px;font-weight:800;text-align:center;margin-bottom:.375rem}
.login-sub{font-size:13px;color:#6b7280;text-align:center;margin-bottom:1.75rem}
.login-err{background:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:.625rem 1rem;font-size:12px;color:#dc2626;margin-bottom:.75rem;display:none}
/* User list */
.user-row{display:flex;align-items:center;padding:12px 16px;border:1px solid #e5e7eb;border-radius:10px;margin-bottom:8px;background:#fff;gap:12px}
.user-ava{width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,#2563eb,#7c3aed);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:14px;flex-shrink:0}
.user-info{flex:1;min-width:0}
.user-name{font-size:13px;font-weight:600;color:#111827}
.user-email{font-size:12px;color:#9ca3af;margin-top:1px}
.user-role{padding:3px 8px;border-radius:5px;font-size:11px;font-weight:600;background:#eff6ff;color:#2563eb;white-space:nowrap}
.user-role.admin{background:#fef3c7;color:#d97706}
/* Topbar user */
.tb-user{display:flex;align-items:center;gap:8px;padding:5px 10px;border-radius:8px;cursor:pointer;border:1px solid #e5e7eb;transition:background .15s}
.tb-user:hover{background:#f9fafb}
.tb-uava{width:28px;height:28px;border-radius:50%;background:linear-gradient(135deg,#2563eb,#7c3aed);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:12px}
.tb-uname{font-size:12px;font-weight:600;color:#374151}
.tb-notif-badge{position:relative;cursor:pointer;width:32px;height:32px;border-radius:50%;background:#ef4444;display:flex;align-items:center;justify-content:center;animation:notifPulse 2s infinite}
.tb-notif-badge span{color:#fff;font-size:11px;font-weight:700;line-height:1}
@keyframes notifPulse{0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,.4)}50%{box-shadow:0 0 0 6px rgba(239,68,68,0)}}
.support-ai-typing{color:#888;animation:dotPulse 1.5s infinite}
@keyframes dotPulse{0%{opacity:.3}50%{opacity:1}100%{opacity:.3}}
/* Modal */
.modal-bg{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:500;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .2s}
.modal-bg.show{opacity:1;pointer-events:auto}
.modal{background:#fff;border-radius:14px;padding:1.75rem;width:440px;max-width:92vw;box-shadow:0 20px 60px rgba(0,0,0,.15)}
.modal h3{font-size:16px;font-weight:700;margin-bottom:1.25rem}
.modal-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:1.25rem}
/* Goods table */
.g-toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem;flex-wrap:wrap;gap:8px;position:sticky;top:0;background:#fff;z-index:10;padding:8px 4px}
.g-count{font-size:13px;color:#6b7280}
.g-table{width:100%;border-collapse:separate;border-spacing:0;font-size:13px}
.g-table th{text-align:left;padding:10px 12px;font-size:11px;font-weight:700;color:#6b7280;text-transform:uppercase;letter-spacing:.04em;border-bottom:2px solid #e5e7eb;white-space:nowrap;position:sticky;top:0;background:#f9fafb;z-index:5}
.g-table thead th.g-pin{z-index:6}
.scard:has(.g-table){overflow-x:auto}
.scard:has(#g-table){max-height:calc(100vh - 140px)}
#s-table-wrap{overflow:auto;max-height:calc(100vh - 300px)}
#s-table thead th{position:sticky;top:0;background:#f9fafb;z-index:5;box-shadow:0 1px 0 #e5e7eb}
.th-hint,.opiu-hint,.db-hint{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:#e5e7eb;color:#6b7280;font-size:11px;font-weight:700;cursor:pointer;margin-left:4px;vertical-align:middle;line-height:1;transition:background .15s,color .15s}
.th-hint:hover,.opiu-hint:hover,.db-hint:hover{background:#2563eb;color:#fff}
.g-table td{padding:10px 12px;border-bottom:1px solid #f3f4f6;vertical-align:middle;background:#fff}
.g-table tr:hover td{background:#f9fafb}
.g-img{width:48px;height:48px;border-radius:8px;object-fit:cover;background:#f3f4f6;cursor:pointer}
.g-img-wrap{position:relative;display:inline-block}
.g-img-wrap:hover .g-img-pop{display:block}
.g-img-pop{display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:300px;height:400px;object-fit:contain;background:#fff;border-radius:12px;box-shadow:0 20px 60px rgba(0,0,0,.3);z-index:500;padding:8px}
.g-title{font-weight:600;color:#111827}
.g-vc{font-size:12px;color:#6b7280;margin-top:2px;word-break:break-all}
.g-cat{padding:3px 8px;border-radius:6px;font-size:11px;font-weight:600;background:#f3f4f6;color:#374151;white-space:nowrap}
.g-dim{font-size:12px;color:#6b7280;white-space:nowrap}
.g-load{text-align:center;padding:3rem;color:#6b7280}
.g-load .spin{display:inline-block;width:24px;height:24px;border:3px solid #e5e7eb;border-top-color:#2563eb;border-radius:50%;animation:gspin .6s linear infinite;margin-bottom:8px}
@keyframes gspin{to{transform:rotate(360deg)}}
.spin-sm{display:inline-block;width:12px;height:12px;border:2px solid #e5e7eb;border-top-color:#2563eb;border-radius:50%;animation:gspin .6s linear infinite}
.g-sortable{cursor:pointer;user-select:none}
.g-sortable:hover{color:#2563eb}
.g-price{font-weight:600;white-space:nowrap}
.g-discount{font-weight:600;color:#dc2626}
.g-final{font-weight:700;color:#059669;white-space:nowrap}
.g-inway{font-size:12px;color:#6b7280;white-space:nowrap}
.g-stock-total{font-weight:700;color:#2563eb;font-size:14px}
.g-forecast-row td{background:#eff6ff !important;border-bottom:2px solid #bfdbfe !important}
.g-forecast-inp{width:100px;padding:5px 8px;border:1.5px solid #2563eb;border-radius:6px;font-size:13px;font-family:inherit;text-align:left;background:#fff}
.g-forecast-inp:focus{outline:none;border-color:#1d4ed8}
.g-fc-label{font-size:11px;color:#2563eb;font-weight:600}
.g-fc-diff{font-size:11px;font-weight:600;margin-top:2px}
.g-fc-diff.up{color:#059669}
.g-fc-diff.down{color:#dc2626}
.g-cost-wrap{display:flex;align-items:center;gap:4px;white-space:nowrap}
.g-cost-input{width:80px;padding:5px 8px;border:1.5px solid #e5e7eb;border-radius:6px;font-size:12px;font-family:inherit;text-align:right}
.g-cost-input:focus{outline:none;border-color:#2563eb}
.g-cost-val{font-weight:600;font-size:13px}
.g-cost-btn{padding:3px 8px;border:1px solid #e5e7eb;border-radius:5px;font-size:11px;font-weight:600;cursor:pointer;background:#fff;color:#374151;font-family:inherit}
.g-cost-btn:hover{background:#f3f4f6}
.g-cost-btn.save{background:#059669;color:#fff;border-color:#059669}
.g-cost-btn.save:hover{background:#047857}
.g-rating{display:flex;align-items:center;gap:4px;white-space:nowrap}
.g-star{color:#f59e0b;font-size:13px}
.g-rating-val{font-weight:700;font-size:13px}

/* --- Индивидуальное закрепление колонок --- */
.g-table th.g-pin,.g-table td.g-pin{position:sticky;background:#fff;z-index:7}
.g-table thead th.g-pin{background:#f9fafb;z-index:8}
.g-table th.g-pin-last,.g-table td.g-pin-last{box-shadow:2px 0 4px -2px rgba(0,0,0,.15)}
.g-pin-btn{display:inline-block;margin-left:4px;cursor:pointer;font-size:11px;opacity:.35;user-select:none;vertical-align:middle}
.g-pin-btn:hover{opacity:.8}
.g-pin-btn.active{opacity:1;color:#2563eb}

/* --- ДИНАМИКА / ABC: sticky toolbar + thead --- */
#s-dyn-toolbar,#s-abc-toolbar{position:sticky;top:0;z-index:12;background:#fff}
#s-dyn-table thead,#s-abc-table thead{position:sticky;top:0;z-index:11}
#s-dyn-table thead th,#s-abc-table thead th{background:#f9fafb;box-shadow:0 1px 0 #e5e7eb}

/* --- ДИНАМИКА: hover-zoom фото артикула --- */
.dyn-img-wrap{position:relative;display:inline-block;line-height:0}
.dyn-img-thumb{width:36px;height:36px;border-radius:6px;object-fit:cover;cursor:pointer}
#dyn-img-popup{display:none;position:fixed;width:220px;height:220px;object-fit:contain;background:#fff;border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,.3);z-index:9999;padding:8px;pointer-events:none}

/* --- ДЕТАЛИЗАЦИЯ: sticky toolbar --- */
#s-detail-toolbar{position:sticky;top:0;z-index:12;background:#fff}
#s-detail-table thead th{background:#f9fafb;box-shadow:0 1px 0 #e5e7eb}

/* --- СКЛАДЫ: табы --- */
.wh-action-btn{display:inline-flex;align-items:center;gap:5px;padding:6px 14px;font-size:12px;font-weight:600;color:#6b7280;background:#f3f4f6;border:1px solid #e5e7eb;border-radius:8px;cursor:pointer;font-family:inherit;transition:all .15s;white-space:nowrap}
.wh-action-btn:hover{color:#374151;background:#e5e7eb;border-color:#d1d5db}
.wh-action-btn.on{color:#2563eb;background:#eff6ff;border-color:#bfdbfe}
.wh-action-btn-icon{width:30px;height:30px;padding:0;justify-content:center;border-radius:50%;font-size:14px;font-weight:700;color:#9ca3af}
.wh-action-btn-icon:hover{color:#6b7280}
.wh-action-btn-icon.on{color:#2563eb;background:#eff6ff;border-color:#bfdbfe}
.wh-tabs{display:flex;gap:0;border-bottom:2px solid #e5e7eb;margin-bottom:16px;overflow-x:auto;scrollbar-width:thin}
.wh-tab{padding:10px 18px;font-size:13px;font-weight:600;color:#6b7280;background:none;border:none;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-2px;font-family:inherit;transition:all .15s;white-space:nowrap;display:inline-flex;align-items:center;gap:4px}
.wh-tab:hover{color:#111827}
.wh-tab.on{color:#2563eb;border-bottom-color:#2563eb}
.wh-panel{}
.wh-wb-view-btn{background:#fff!important;color:#9ca3af!important;transition:all .15s}
.wh-wb-view-btn:hover{color:#374151!important;background:#f9fafb!important}
.wh-wb-view-btn.on{background:#2563eb!important;color:#fff!important}
.wh-task-filter-btn{background:#fff!important;color:#9ca3af!important;border:1px solid #e5e7eb!important;transition:all .15s}
.wh-task-filter-btn:hover{color:#374151!important;background:#f9fafb!important}
.wh-task-filter-btn.on{background:#2563eb!important;color:#fff!important;border-color:#2563eb!important}
.smodal-bg{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:500;display:flex;align-items:center;justify-content:center}
.smodal{background:#fff;border-radius:12px;padding:24px;width:90%;box-shadow:0 20px 60px rgba(0,0,0,.2);max-height:90vh;overflow-y:auto}
.smodal-title{font-size:18px;font-weight:700;margin-bottom:16px}
.wh-ph{object-fit:cover;border-radius:4px;transition:transform .2s ease;cursor:pointer}
.aif-typing{animation:aifBlink 1s infinite;color:#9ca3af;font-size:18px;letter-spacing:3px}
.aif-cursor{animation:aifBlink .6s infinite;color:#8b5cf6;font-weight:700}
@keyframes aifBlink{0%,50%{opacity:1}51%,100%{opacity:0}}
.aif-suggest:hover{background:#ede9fe!important;border-color:#c4b5fd!important}
#aif-messages{scrollbar-width:thin;scrollbar-color:#d1d5db transparent}
#aif-messages::-webkit-scrollbar{width:6px}
#aif-messages::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}
.wh-ph:hover{transform:scale(2.2);z-index:50;position:relative;box-shadow:0 4px 16px rgba(0,0,0,.25);border-radius:6px}
/* Goods column help buttons */
.g-help{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:#e5e7eb;color:#6b7280;font-size:10px;font-weight:700;text-align:center;line-height:1;cursor:pointer;margin-left:4px;vertical-align:middle;flex-shrink:0;border:none;padding:0;transition:background .15s,color .15s}
.g-help:hover{background:#3b82f6;color:#fff}
/* Help popover */
.g-help-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.25);z-index:9998;animation:ghFadeIn .15s ease}
.g-help-overlay.show{display:block}
.g-help-pop{position:fixed;z-index:9999;background:#fff;border-radius:12px;box-shadow:0 8px 32px rgba(0,0,0,.18);max-width:420px;width:calc(100vw - 32px);max-height:80vh;overflow-y:auto;animation:ghSlideIn .2s ease}
.g-help-pop-hd{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 10px;border-bottom:1px solid #f3f4f6;position:sticky;top:0;background:#fff;border-radius:12px 12px 0 0;z-index:1}
.g-help-pop-title{font-size:15px;font-weight:700;color:#111827}
.g-help-pop-close{width:28px;height:28px;border-radius:50%;border:none;background:#f3f4f6;color:#6b7280;font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s}
.g-help-pop-close:hover{background:#e5e7eb;color:#111}
.g-help-pop-body{padding:12px 16px 16px;font-size:13px;line-height:1.6;color:#374151}
.g-help-pop-body b{color:#111827}
.g-help-section{margin-top:10px}
.g-help-section-label{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:#9ca3af;margin-bottom:4px}
.g-help-formula{background:#f8fafc;border:1px solid #e5e7eb;border-radius:8px;padding:10px 12px;font-family:'SF Mono','Fira Code',monospace;font-size:12px;line-height:1.7;color:#1e293b;margin-top:4px;white-space:pre-wrap}
.g-help-example{background:#eff6ff;border:1px solid #bfdbfe;border-radius:8px;padding:10px 12px;font-size:12px;line-height:1.6;color:#1e40af;margin-top:6px}
@keyframes ghFadeIn{from{opacity:0}to{opacity:1}}
@keyframes ghSlideIn{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:500px){.g-help-pop{max-width:100vw;width:100vw;border-radius:12px 12px 0 0;bottom:0;left:0;right:0;top:auto;max-height:75vh;animation:ghSlideUp .25s ease}.g-help-pop-hd{border-radius:12px 12px 0 0}@keyframes ghSlideUp{from{transform:translateY(100%)}to{transform:translateY(0)}}}

/* ═══ Admin Panel ═══ */
.admin-stats-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px;margin-bottom:24px}
.astat-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px;text-align:center}
.astat-val{font-size:28px;font-weight:700;color:#1a1d23}
.astat-lbl{font-size:12px;color:#6b7280;margin-top:4px}
.admin-tabs{display:flex;gap:4px;margin-bottom:16px;border-bottom:2px solid #e5e7eb;padding-bottom:0}
.admin-tab{background:none;border:none;padding:10px 20px;font-size:14px;font-weight:500;cursor:pointer;color:#6b7280;border-bottom:2px solid transparent;margin-bottom:-2px;transition:all .15s}
.admin-tab.active{color:#4f46e5;border-bottom-color:#4f46e5}
.admin-tab:hover{color:#1a1d23}
.admin-toolbar{display:flex;gap:10px;margin-bottom:14px;flex-wrap:wrap}
.admin-search-input{padding:8px 14px;border:1px solid #d1d5db;border-radius:8px;font-size:13px;width:280px;outline:none}
.admin-search-input:focus{border-color:#4f46e5;box-shadow:0 0 0 2px rgba(79,70,229,.15)}
.admin-filter-select{padding:8px 12px;border:1px solid #d1d5db;border-radius:8px;font-size:13px;outline:none;background:#fff}
.admin-table-wrap{overflow-x:auto}
.admin-tbl{width:100%;border-collapse:collapse;font-size:13px;background:#fff;border-radius:10px;overflow:hidden;border:1px solid #e5e7eb}
.admin-tbl thead{background:#f8f9fb}
.admin-tbl th{padding:10px 12px;text-align:left;font-weight:600;color:#374151;border-bottom:2px solid #e5e7eb;white-space:nowrap}
.admin-tbl td{padding:8px 12px;border-bottom:1px solid #f3f4f6;vertical-align:middle}
.admin-tbl tr:hover{background:#f8f9fb}
.admin-tbl-sm{font-size:12px}
.admin-tbl-sm th,.admin-tbl-sm td{padding:6px 10px}
.admin-actions{display:flex;gap:4px}
.admin-btn-sm{background:none;border:1px solid #d1d5db;border-radius:6px;padding:4px 8px;cursor:pointer;font-size:14px;transition:all .15s}
.admin-btn-sm:hover{background:#f3f4f6}
.admin-btn-sm.admin-btn-red:hover{background:#fee2e2;border-color:#fca5a5}
.admin-btn-sm.admin-btn-green:hover{background:#d1fae5;border-color:#6ee7b7}
.admin-btn{padding:8px 16px;border:1px solid #d1d5db;border-radius:8px;font-size:13px;cursor:pointer;background:#fff;transition:all .15s}
.admin-btn:hover{background:#f3f4f6}
.admin-btn-primary{background:#4f46e5;color:#fff;border-color:#4f46e5}
.admin-btn-primary:hover{background:#4338ca}
.admin-btn-danger{background:#ef4444;color:#fff;border-color:#ef4444}
.admin-btn-danger:hover{background:#dc2626}
.admin-btn-green{background:#10b981;color:#fff;border-color:#10b981}
.admin-btn-green:hover{background:#059669}
.admin-modal{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.5);z-index:9999;display:flex;align-items:center;justify-content:center}
.admin-modal-content{background:#fff;border-radius:16px;padding:24px;max-width:700px;width:95%;max-height:85vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,.2)}
.admin-modal-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}
.admin-modal-header h3{font-size:18px;font-weight:600}
.admin-modal-close{background:none;border:none;font-size:24px;cursor:pointer;color:#6b7280;padding:4px 8px}
.admin-modal-close:hover{color:#1a1d23}
.admin-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.admin-detail-grid>div{padding:8px 12px;background:#f8f9fb;border-radius:8px;font-size:13px}
.admin-charts-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:20px}
.admin-chart-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px}
.admin-chart-card h4{margin:0 0 12px;font-size:14px;color:#374151}
.admin-recent-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:24px}
.admin-recent-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px}
.admin-recent-card h4{margin:0 0 12px;font-size:14px;color:#374151}
.admin-recent-item{display:flex;align-items:center;gap:10px;padding:6px 0;border-bottom:1px solid #f3f4f6;font-size:13px}
.admin-recent-item:last-child{border-bottom:none}
.admin-recent-name{font-weight:500;min-width:100px}
.admin-recent-email{color:#6b7280;flex:1}
.admin-recent-date{color:#9ca3af;font-size:11px;white-space:nowrap}
.admin-pagination{display:flex;align-items:center;justify-content:space-between;margin-top:12px;flex-wrap:wrap;gap:8px}
.admin-pag-info{font-size:12px;color:#6b7280}
.admin-pag-btns{display:flex;gap:4px}
.admin-pag-btn{padding:4px 10px;border:1px solid #d1d5db;border-radius:6px;background:#fff;cursor:pointer;font-size:12px;transition:all .15s}
.admin-pag-btn:hover{background:#f3f4f6}
.admin-pag-btn.active{background:#4f46e5;color:#fff;border-color:#4f46e5}
@media(max-width:768px){.admin-charts-row,.admin-recent-row{grid-template-columns:1fr}}

/* ═══ Support / Техподдержка ═══ */
.support-page{max-width:900px}
.support-top-bar{display:flex;gap:10px;margin-bottom:16px;align-items:center}
.support-btn{padding:8px 16px;border:1px solid #d1d5db;border-radius:8px;font-size:13px;cursor:pointer;background:#fff;transition:all .15s}
.support-btn:hover{background:#f3f4f6}
.support-btn-primary{background:#4f46e5;color:#fff;border-color:#4f46e5}
.support-btn-primary:hover{background:#4338ca}
.support-label{font-size:13px;font-weight:500;color:#374151;display:block;margin-bottom:4px}
.support-input{width:100%;padding:8px 12px;border:1px solid #d1d5db;border-radius:8px;font-size:13px;outline:none;font-family:inherit}
.support-input:focus{border-color:#4f46e5;box-shadow:0 0 0 2px rgba(79,70,229,.15)}
.support-textarea{min-height:120px;resize:vertical}
.support-create-form{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:24px;max-width:600px}
.support-tickets-list{display:flex;flex-direction:column;gap:8px}
.support-ticket-card{background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:14px 18px;cursor:pointer;transition:all .15s}
.support-ticket-card:hover{border-color:#4f46e5;box-shadow:0 2px 8px rgba(79,70,229,.1)}
.support-ticket-top{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:6px}
.support-ticket-id{font-weight:600;color:#6b7280;font-size:13px}
.support-ticket-cat{font-size:11px;color:#6b7280;background:#f3f4f6;padding:2px 6px;border-radius:6px}
.support-ticket-date{font-size:11px;color:#9ca3af;margin-left:auto}
.support-ticket-msgs{font-size:11px;color:#6b7280}
.support-ticket-subject{font-size:15px;font-weight:500;color:#1a1d23}
.support-ticket-user{font-size:12px;color:#6b7280;margin-top:4px}
.support-chat-header{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px;margin-bottom:12px}
.support-chat-hd-top{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:6px}
.support-chat-hd-subject{font-size:16px;font-weight:600;color:#1a1d23}
.support-admin-actions{display:flex;gap:6px;margin-top:10px;flex-wrap:wrap;align-items:center}
.support-chat-messages{background:#f8f9fb;border:1px solid #e5e7eb;border-radius:12px;padding:16px;max-height:400px;overflow-y:auto;display:flex;flex-direction:column;gap:10px}
.support-msg{padding:10px 14px;border-radius:10px;max-width:85%;font-size:13px;line-height:1.5}
.support-msg-user{background:#4f46e5;color:#fff;align-self:flex-end;border-bottom-right-radius:4px}
.support-msg-ai{background:#fff;border:1px solid #e5e7eb;align-self:flex-start;border-bottom-left-radius:4px}
.support-msg-admin{background:#fef3c7;border:1px solid #fcd34d;align-self:flex-start;border-bottom-left-radius:4px}
.support-msg-header{display:flex;justify-content:space-between;gap:10px;margin-bottom:4px}
.support-msg-sender{font-weight:600;font-size:11px;opacity:.8}
.support-msg-time{font-size:10px;opacity:.6}
.support-msg-body{word-break:break-word}
.support-msg-user .support-msg-sender,.support-msg-user .support-msg-time{color:#fff}
.support-chat-input{display:flex;gap:10px;margin-top:12px;align-items:flex-end}
.support-chat-input textarea{flex:1;min-height:40px;max-height:120px;resize:vertical}
.support-spec-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px}
.support-spec-text{white-space:pre-wrap;font-size:13px;background:#f8f9fb;padding:14px;border-radius:8px;border:1px solid #e5e7eb;max-height:300px;overflow-y:auto;line-height:1.6}
