:root{--bg:#071019;--panel:#0d1821;--line:#22313c;--txt:#eef3f5;--mut:#8998a2;--orange:#ffad18}
body.portal{margin:0;background:var(--bg);color:var(--txt);font-family:Inter,"Segoe UI",Arial,sans-serif}.portal-nav{height:58px;border-bottom:1px solid var(--line);background:#0b141c;display:flex;align-items:center;padding:0 20px;gap:10px;position:sticky;top:0;z-index:90}.portal-brand{font-weight:900;margin-right:20px}.portal-brand span{color:var(--orange)}.portal-nav a{color:#c6d0d6;text-decoration:none;padding:10px 13px;border-radius:5px}.portal-nav a.active,.portal-nav a:hover{background:#241d12;color:var(--orange)}.portal-user{margin-left:auto}.portal-content{min-height:calc(100vh - 58px)}.embed-head{display:flex;justify-content:space-between;align-items:center;padding:18px 24px}.embed-head h1{margin:0;font-size:20px}.embed-head p{margin:5px 0 0;color:var(--mut)}.open-full{color:var(--orange)}.craft-frame{border:0;width:100%;height:calc(100vh - 135px);background:#071019}.account{max-width:900px;margin:30px auto;padding:24px;background:#0d1821;border:1px solid var(--line);border-radius:8px}.login-buttons{display:flex;gap:12px}.login-buttons a{padding:12px 16px;border:1px solid #3a4b56;border-radius:6px;color:white;text-decoration:none}.settings-bg{display:none;position:fixed;inset:0;background:#0009;z-index:500;align-items:center;justify-content:center}.settings-bg.open{display:flex}.settings-modal{width:min(680px,94vw);background:#0d1821;border:1px solid #41535f;border-radius:9px;box-shadow:0 30px 90px #000b}.settings-head,.settings-foot{padding:16px 18px;border-bottom:1px solid #22313c;display:flex;justify-content:space-between;align-items:center}.settings-head button{font-size:25px;background:none;border:0;color:white}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px;padding:18px}.settings-grid label{display:grid;gap:7px;color:#aeb8be;font-size:12px}.settings-grid input,.settings-grid select{height:40px;background:#09131b;border:1px solid #344753;color:white;border-radius:5px;padding:0 10px}.settings-grid .toggle{display:flex;align-items:center;gap:9px}.settings-grid .toggle input{width:18px;height:18px}.settings-foot{border-top:1px solid #22313c;border-bottom:0;justify-content:flex-end;gap:9px}.settings-foot button{height:38px;padding:0 15px;border:1px solid #3a4b56;background:#14212a;color:white;border-radius:5px}.settings-foot .primary{background:#f2a314;color:#171109;border-color:#ffb329;font-weight:800}
/* ===== v7.10 CMS shell ===== */
:root{--cms-side:218px;--bg:#071019;--panel:#0d1821;--line:#22313c;--txt:#eef3f5;--mut:#8998a2;--orange:#ffad18}
body.portal{display:grid;grid-template-columns:var(--cms-side) minmax(0,1fr);min-height:100vh;background:radial-gradient(circle at 80% 0,#0e1b27 0,#071019 42%)}
.cms-sidebar{position:sticky;top:0;height:100vh;background:linear-gradient(180deg,#0b141d,#091119);border-right:1px solid #1e2c36;padding:18px 12px;display:flex;flex-direction:column;gap:12px;z-index:100}.cms-brand{font-size:20px;font-weight:950;padding:2px 8px 13px}.cms-brand span{color:var(--orange)}.cms-profile-mini{display:flex;align-items:center;gap:9px;padding:10px;border:1px solid #22333f;background:#0e1922;border-radius:8px;text-decoration:none;color:#e9eef1}.cms-profile-mini i{width:34px;height:34px;border-radius:50%;background:#f1a719;color:#171108;display:grid;place-items:center;font-style:normal;font-weight:950}.cms-profile-mini b,.cms-profile-mini small{display:block;max-width:135px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cms-profile-mini small{color:#6fdd78;font-size:9px;margin-top:3px}.cms-nav-title{padding:7px 8px 3px;color:#5f707a;text-transform:uppercase;font-size:9px;letter-spacing:.8px}.cms-nav{display:grid;gap:3px}.cms-nav a{height:38px;display:flex;align-items:center;gap:9px;padding:0 9px;border-radius:6px;color:#aeb9bf;text-decoration:none;font-size:12px}.cms-nav a:hover,.cms-nav a.active{background:linear-gradient(90deg,#292112,#161a1c);color:#ffb31e}.cms-support{margin-top:auto;border:1px solid #21323d;border-radius:7px;padding:10px;color:#758791;font-size:10px}.cms-support b{display:block;color:#d9e1e5;margin-bottom:4px}.cms-main{min-width:0}.cms-topbar{height:64px;border-bottom:1px solid #1f2e38;display:flex;align-items:center;justify-content:space-between;padding:0 22px;background:rgba(8,16,23,.86);backdrop-filter:blur(8px);position:sticky;top:0;z-index:80}.cms-topbar h1{font-size:16px;margin:0}.cms-top-actions{display:flex;align-items:center;gap:9px}.cms-wallet{display:flex;align-items:center;gap:9px;border:1px solid #293b46;border-radius:7px;padding:7px 9px;color:#9aa8b0;text-decoration:none}.cms-wallet b{color:#ffb21a}.cms-content{padding:16px 20px 30px}.page-kicker{color:#f1a716;font-size:10px;text-transform:uppercase;letter-spacing:.8px;font-weight:850}.simple-page{max-width:1150px}.simple-page>.page-card{padding:24px}.simple-page h1{margin:6px 0 9px}.simple-page p{color:#83939c}.portal-nav{display:none!important}.portal-content{min-height:0}.cms-content .app{display:block!important;min-height:auto!important;background:none!important}.cms-content .app>.sidebar{display:none!important}.cms-content .app>.main{max-width:none!important;padding:0!important}.cms-content .app .topbar{margin-top:0}.cms-content .craft-frame{height:calc(100vh - 150px)}@media(max-width:900px){body.portal{display:block}.cms-sidebar{position:relative;width:100%;height:auto}.cms-nav{grid-template-columns:1fr 1fr}.cms-topbar{position:relative}.cms-content{padding:10px}}

/* ===== v7.11: enlarged typography for new CMS UI ===== */
.cms-sidebar{font-size:16px}
.cms-brand{font-size:28px}
.cms-profile-mini b{font-size:16px}
.cms-profile-mini small{font-size:13px}
.cms-nav-title{font-size:13px}
.cms-nav a{font-size:16px;height:48px}
.cms-support{font-size:14px}
.cms-topbar{height:78px}
.cms-topbar h1{font-size:22px}
.cms-wallet{font-size:16px}
.page-kicker{font-size:14px}
.simple-page h1{font-size:32px}
.simple-page p{font-size:18px;line-height:1.55}
.cms-logo-img{display:block;max-width:100%;max-height:64px;object-fit:contain;object-position:left center}
.cms-brand.has-logo{height:76px;display:flex;align-items:center;padding:0 8px 10px}

/* ===== v7.12 supplied logo ===== */
.cms-brand.has-logo{
  height:108px;
  padding:4px 8px 12px;
  overflow:hidden;
}
.cms-logo-img{
  width:100%;
  height:92px;
  max-height:92px;
  object-fit:contain;
  object-position:center center;
  filter:drop-shadow(0 5px 12px rgba(0,0,0,.35));
}

/* ===== v7.13 larger sidebar logo ===== */
.cms-brand.has-logo{
  width:250px;
  height:250px;
  max-width:100%;
  padding:0;
  margin:0 auto 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:visible;
}
.cms-logo-img{
  width:250px;
  height:250px;
  max-width:250px;
  max-height:250px;
  object-fit:contain;
  object-position:center;
}

/* ===== v7.14 logo size only: 200x200 ===== */
.cms-brand.has-logo{
  width:200px;
  height:200px;
}
.cms-logo-img{
  width:200px;
  height:200px;
  max-width:200px;
  max-height:200px;
}

/* ===== v7.15 sidebar: scroll when nav doesn't fit the viewport ===== */
.cms-sidebar{
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:#31424e transparent;
}
.cms-sidebar::-webkit-scrollbar{
  width:8px;
}
.cms-sidebar::-webkit-scrollbar-track{
  background:transparent;
}
.cms-sidebar::-webkit-scrollbar-thumb{
  background:#2b3c48;
  border-radius:4px;
}
.cms-sidebar::-webkit-scrollbar-thumb:hover{
  background:#3c5361;
}
/* keep the brand (logo + label) inside the sidebar column instead of painting over the page */
.cms-sidebar .cms-brand a{
  flex-wrap:wrap;
}
.cms-sidebar .cms-logo-img{
  width:auto;
  height:auto;
  max-width:100%;
  max-height:200px;
}

/* Узкие окна: на нескольких страницах блоки были зафиксированы по ширине (склад 390px,
   выгодные лоты и профиль 1138px, разделы админки ~1525px) и вылезали за экран.
   Ограничение только «сжимает» блок, когда он не влезает, — широкая раскладка не меняется. */
@media(max-width:1700px){
  .warehouse-layout,
  .warehouse-toolbar,
  .warehouse-side,
  .profit-head,
  .profit-info,
  .profit-tabs,
  .account-profile-strip,
  .account-grid,
  .account-card,
  .admin-head,
  .admin-tabs,
  .admin-root-access,
  .admin-shell{
    max-width:100%;
    box-sizing:border-box;
  }
}

/* === Переключатель языка интерфейса в сайдбаре === */
.cms-lang-switch{display:flex;gap:6px;padding:2px 2px 0}
.cms-lang-switch button{
  flex:1;
  height:32px;
  border:1px solid #263844;
  border-radius:6px;
  background:#0d1720;
  color:#93a3ac;
  font-family:inherit;
  font-size:12px;
  font-weight:800;
  letter-spacing:.4px;
  cursor:pointer;
  transition:border-color .15s,color .15s,background .15s;
}
.cms-lang-switch button:hover{border-color:#8e6820;color:#ffb31d}
.cms-lang-switch button.active{border-color:#f3ac1a;background:linear-gradient(180deg,#ffbe31,#e99a08);color:#171108}
.cms-lang-switch button:disabled{opacity:.6;cursor:default}
