:root{
  --red:#d60000;
  --black:#111;
  --gray:#f4f4f6;
  --text:#111;
  --muted:#666;
  --border:#e6e6e6;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --shadow2: 0 16px 40px rgba(0,0,0,.12);
  --r12:12px;
  --r14:14px;
  --r16:16px;
  --r18:18px;
  --r999:999px;
}

*{ box-sizing:border-box; }

html, body{
  height:100%;
  background:#fff;
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  -webkit-text-size-adjust: 100%;
}

a{ color:inherit; text-decoration:none; }

/* -------------------- Layout -------------------- */

.container{ width:min(1100px, 92vw); margin:0 auto; }
main.container{ min-height: calc(100vh - 110px); }

/* -------------------- Public header -------------------- */

.header{
  position:sticky;
  top:0;
  background:#fff;
  border-bottom:1px solid #eee;
  z-index:50;

  backface-visibility:hidden;
  transform: translateZ(0);
}

.header__inner{
  display:flex;
  align-items:center;
  gap:16px;
  padding:14px 0;
}

.logo{ font-weight:900; letter-spacing:.4px; }
.nav{ display:flex; gap:14px; margin-left:auto; }

/* старый .phone можно оставить на будущее, не мешает */
.phone{ padding:8px 12px; border:1px solid #eee; border-radius:var(--r12); background:#fff; }

/* -------------------- Logo (final, wide logo) -------------------- */

.logo-link{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  padding:4px 0;
  border-radius:12px;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
}

.logo-img{
  height:52px;
  width:auto;
  display:block;
  max-width:none;
  image-rendering:auto;
  transform: translateZ(0);
  transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}

.logo-link:hover .logo-img{
  transform: translateY(-1px);
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.12));
}
.logo-link:active .logo-img{ transform: translateY(0); opacity:.95; }

.logo-link:focus{
  outline:2px solid rgba(214,0,0,.35);
  outline-offset:3px;
}

body:not(.is-home) .logo-img{ height:46px; }

@media (max-width: 900px){
  .logo-img{ height:38px; }
  body:not(.is-home) .logo-img{ height:34px; }
}

/* -------------------- City selector -------------------- */

.city{ position:relative; }

.city__btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border:1px solid #eee;
  border-radius:12px;
  background:#fff;
  cursor:pointer;
  font-weight:800;
  -webkit-tap-highlight-color: transparent;
}
.city__caret{ opacity:.7; }

.city__panel{
  position:absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(680px, 92vw);
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.12);
  padding:14px;
  z-index:200;
}

.city__grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:8px;
}

.city__item{
  text-align:left;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid #eee;
  background:#fff;
  cursor:pointer;
  font-weight:700;
}
.city__item:hover{ border-color: rgba(214,0,0,.25); }
.city__item.is-active{
  border-color: rgba(214,0,0,.35);
  color: var(--red);
}

@media (max-width: 900px){
  .city__grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* -------------------- Header contact (PC) -------------------- */

.header-contact{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:6px;
  margin-left:12px;
}

.header-phone{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:8px 14px;
  border-radius:var(--r999);
  border:1px solid var(--border);
  background:#fff;
  font-weight:900;
  font-size:15px;
  white-space:nowrap;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.header-phone:hover{
  border-color: rgba(214,0,0,.35);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.header-phone__icon{ font-size:18px; }
.header-phone__number{ letter-spacing:.3px; }

/* online badge */
.header-online{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-left:6px;
  padding:4px 10px;
  border-radius:var(--r999);
  border:1px solid rgba(0,0,0,.08);
  background:#fff;
  font-size:12px;
  font-weight:900;
  color:var(--muted);
}

.header-online__dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background:#22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,.18);
  animation: onlinePulse 1.2s ease-in-out infinite;
}

@keyframes onlinePulse{
  0%{ transform: scale(1); opacity:1; }
  50%{ transform: scale(1.15); opacity:.85; }
  100%{ transform: scale(1); opacity:1; }
}

/* messenger icons (PC) */
.header-messengers{
  display:flex;
  align-items:center;
  gap:8px;
}

.msgr{
  width:34px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:var(--r12);
  border:1px solid var(--border);
  background:#fff;
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.msgr:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0,0,0,.08);
  border-color: rgba(214,0,0,.25);
}

.msgr__ico{
  width:18px;
  height:18px;
  display:block;
  fill: currentColor;
}

.msgr--tg{ color:#229ED9; }
.msgr--max{ color:#111; }

/* -------------------- Common UI -------------------- */

.hero{ padding:22px 0; }
.muted{ color:var(--muted); }

.card{
  border:1px solid #eee;
  border-radius:var(--r16);
  padding:14px;
  background:#fff;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap:14px; }

@media (max-width:900px){
  .grid{ grid-template-columns: repeat(2, 1fr); }
  .nav{ display:none; }
  .header-contact{ display:none; } /* на мобилке контакт в хедере скрываем */
}

/* -------------------- Buttons -------------------- */

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:var(--r14);
  background:var(--black);
  color:#fff !important;
  border:none;
  cursor:pointer;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, opacity .12s ease, box-shadow .12s ease;
}

.btn:hover{ opacity:.92; transform: translateY(-1px); }
.btn:active{ opacity:.88; transform: translateY(0); }

.btn:focus{
  outline: 2px solid rgba(214,0,0,.35);
  outline-offset: 2px;
}

.btn--red{ background:var(--red); color:#fff !important; }
.btn--sm{ padding:8px 12px; font-size:13px; border-radius:var(--r12); }

.btn--ghost{
  background:#fff;
  border:1px solid var(--border);
  color:var(--black) !important;
}
.btn--ghost:hover{
  background:#fafafa;
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
}

/* -------------------- Filters -------------------- */

.filters{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  padding:12px;
  background:var(--gray);
  border-radius:var(--r16);
}

.filters select,
.filters input,
.filters button{
  padding:10px 12px;
  border:1px solid #ddd;
  border-radius:var(--r12);
  background:#fff;
}

.filters button{
  border:none;
  cursor:pointer;
}

/* -------------------- Tags / badges -------------------- */

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:var(--r999);
  font-size:12px;
  font-weight:900;
  line-height:1;
}

.badge--red{ background:var(--red); color:#fff; }

.tag{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:var(--r999);
  font-size:12px;
  border:1px solid var(--border);
  background:#fff;
}
.tag--red{ background:var(--red); color:#fff; border-color: rgba(214,0,0,.2); }
.tag--black{ background:var(--black); color:#fff; border-color: rgba(0,0,0,.2); }

.link{ color:var(--red); font-weight:800; }
.link:hover{ text-decoration:underline; }

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 12px;
  border-radius:var(--r999);
  border:1px solid var(--border);
  background:#fff;
  font-size:13px;
}
.dot{
  width:10px;
  height:10px;
  border-radius:var(--r999);
  background: var(--red);
}

/* -------------------- Status badge (leads) -------------------- */

.badge-status{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:4px 10px;
  border-radius:var(--r999);
  font-size:12px;
  border:1px solid var(--border);
  background:#fff;
}

.badge-status--new{ border-color: rgba(214,0,0,.25); }
.badge-status--in_work{ border-color: rgba(0,0,0,.18); }
.badge-status--done{ border-color: rgba(0,0,0,.18); }
.badge-status--rejected{ border-color: rgba(0,0,0,.18); opacity:.85; }

/* -------------------- Product cards -------------------- */

.card--product{
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  min-height:160px;
}

.card__title{ font-weight:800; line-height:1.3; }

.card__meta{
  margin-top:6px;
  font-size:13px;
  color:var(--muted);
}

.card__price{
  margin-top:10px;
  font-size:18px;
  font-weight:900;
}

.card__footer{
  margin-top:14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.card__point{ font-size:12px; color:var(--muted); }

/* -------------------- Product page -------------------- */

.crumbs{ margin-top:16px; }
.crumbs a{ color:var(--muted); }

.product{
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap:14px;
  margin-top:14px;
  align-items:start;
}

/* MEDIA CARD */
.product__media{
  padding:14px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
}

.product__img{
  width:100%;
  height:auto;
  max-height: 520px;
  object-fit: contain;
  object-position:center;
  display:block;
}

.product__placeholder{
  width:100%;
  min-height:420px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  background:var(--gray);
  border-radius: var(--r14);
}

.product__title{ margin:0; line-height:1.15; }
.product__price{ font-size:28px; font-weight:900; margin-top:10px; }
.product__chips{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }

.chip{
  font-size:12px;
  padding:6px 10px;
  border:1px solid #eee;
  border-radius:var(--r999);
  background:#fff;
}

.product__desc{ margin-top:12px; }
.product__point{ margin-top:12px; }
.product__actions{ display:flex; gap:10px; margin-top:12px; flex-wrap:wrap; }

@media (max-width:900px){
  .product{ grid-template-columns: 1fr; }
  .product__media{ padding:10px; }
  .product__img{ max-height: 360px; }
  .product__placeholder{ min-height: 300px; }
}

/* lead forms */
.leadform{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.leadform__input{
  padding:10px 12px;
  border:1px solid #ddd;
  border-radius:var(--r12);
  background:#fff;
  min-width:220px;
}

/* -------------------- New lead highlight -------------------- */

.lead-new{
  border:1px solid rgba(214,0,0,.35) !important;
  box-shadow: 0 0 0 4px rgba(214,0,0,.08);
  animation: leadPulse 1s ease-in-out 2;
}
@keyframes leadPulse{
  0%{ transform: translateY(0); }
  50%{ transform: translateY(-1px); }
  100%{ transform: translateY(0); }
}

/* -------------------- Toast -------------------- */

.toast-host{
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast{
  width: min(360px, calc(100vw - 28px));
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: var(--r16);
  box-shadow: var(--shadow2);
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease;
}
.toast--show{ opacity: 1; transform: translateY(0); }
.toast__title{ font-weight: 900; margin-bottom: 4px; }
.toast__text{ font-size: 13px; color: #222; }

/* -------------------- Admin UI -------------------- */

.admin-body{ background:#fff; }

.admin-top{
  position: sticky;
  top: 0;
  z-index: 100;
  background:#fff;
  border-bottom:1px solid #eee;
  backface-visibility:hidden;
  transform: translateZ(0);
}

.admin-top__inner{
  width:min(1200px, 94vw);
  margin:0 auto;
  display:flex;
  align-items:center;
  gap:14px;
  padding:12px 0;
}

.admin-brand{ font-weight:900; color:#111; }

.admin-nav{
  display:flex;
  gap:6px;
  margin-left: 8px;
}

.admin-nav a{
  font-weight:800;
  padding:8px 10px;
  border-radius:var(--r12);
}
.admin-nav a:hover{ background:#f6f6f6; }

.admin-right{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:10px;
}

.admin-subbar{
  border-top:1px solid #f1f1f1;
  background:#fff;
}

.admin-subbar__inner{
  width:min(1200px, 94vw);
  margin:0 auto;
  padding:8px 0;
}

.admin-container{
  width:min(1200px, 94vw);
  margin:0 auto;
  padding: 14px 0 28px;
}

.admin-login{
  min-height: 100vh;
  display:flex;
  align-items:center;
  padding: 20px;
}

.admin-tiles{
  margin-top: 14px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 900px){
  .admin-tiles{ grid-template-columns: 1fr; }
  .admin-nav{ display:none; }
}

.admin-tile{
  display:block;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r18);
  background:#fff;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.admin-tile:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: rgba(214,0,0,.25);
}
.admin-tile__title{
  font-weight:900;
  font-size:18px;
  display:flex;
  align-items:center;
  gap:10px;
}
.admin-tile__desc{
  margin-top:8px;
  color:var(--muted);
  font-size:13px;
}

/* -------------------- Product images gallery -------------------- */

.upload-form{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.image-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap:10px;
}

.image-item{
  position:relative;
  border:1px solid var(--border);
  border-radius: var(--r14);
  overflow:hidden;
  background:#fff;
}

.image-item img{
  width:100%;
  height:140px;
  object-fit:cover;
  display:block;
}

.img-del{
  position:absolute;
  top:8px;
  right:8px;
  width:32px;
  height:32px;
  border-radius: 12px;
  border:1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.92);
  cursor:pointer;
  font-weight:900;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
}
.img-del:hover{
  border-color: rgba(214,0,0,.35);
  box-shadow: 0 10px 25px rgba(0,0,0,.10);
}

/* -------------------- Catalog product cards (balanced size) -------------------- */

.card--product2{
  padding:12px;
  display:grid;
  grid-template-columns: 120px 1fr;
  gap:14px;
  align-items:center;
}

.card--product2 .card__thumb{
  border-radius: var(--r14);
  overflow:hidden;
  background:#fff;
  border:1px solid #e6e6e6;
  display:flex;
  align-items:center;
  justify-content:center;
}

.card--product2 .card__thumb img{
  width:100%;
  height:96px;
  object-fit:contain;
  object-position:center;
  display:block;
  background:#fff;
}

.card--product2 .card__thumb-ph{
  width:100%;
  height:96px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  font-weight:800;
  background:#f6f6f6;
}

.card--product2 .card__title{
  font-weight:900;
  line-height:1.25;
  font-size:15px;
  margin:0;
}

.card--product2 .card__meta{
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
}

.card--product2 .card__price{
  margin-top:6px;
  font-size:18px;
  font-weight:900;
}

.card--product2 .card__footer{
  margin-top:8px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.card--product2 .card__point{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:70%;
}

@media (max-width:900px){
  .card--product2{ grid-template-columns: 130px 1fr; }
  .card--product2 .card__thumb img,
  .card--product2 .card__thumb-ph{ height:110px; }
}

/* -------------------- Catalog view switch -------------------- */

.viewbar{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:12px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius: var(--r16);
  background:#fff;
}

.viewbar__spacer{ flex:1; }

.viewbtn{
  width:38px;
  height:38px;
  border-radius: var(--r12);
  border:1px solid var(--border);
  background:#fff;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.viewbtn:hover{ transform: translateY(-1px); box-shadow: var(--shadow); }
.viewbtn.is-active{
  border-color: rgba(214,0,0,.35);
  box-shadow: 0 0 0 4px rgba(214,0,0,.08);
}

.view-ico{
  width:18px;
  height:18px;
  position:relative;
}
.view-ico--grid::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(#111,#111) 0 0/6px 6px no-repeat,
    linear-gradient(#111,#111) 12px 0/6px 6px no-repeat,
    linear-gradient(#111,#111) 0 12px/6px 6px no-repeat,
    linear-gradient(#111,#111) 12px 12px/6px 6px no-repeat;
  opacity:.85;
}
.view-ico--list::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(#111,#111) 0 2px/18px 2px no-repeat,
    linear-gradient(#111,#111) 0 8px/18px 2px no-repeat,
    linear-gradient(#111,#111) 0 14px/18px 2px no-repeat;
  opacity:.85;
}

/* -------------------- Catalog layouts -------------------- */

.catalog{ display:grid; gap:14px; }

.catalog.catalog--full{
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width:900px){
  .catalog.catalog--full{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.catalog.catalog--compact{ grid-template-columns: 1fr; }

.catalog.catalog--full .card--product-compact{ display:none !important; }
.catalog.catalog--compact .card--product-full{ display:none !important; }

/* FULL card */
.card--product-full{
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.card--product-full .card__thumb{
  border-radius: var(--r14);
  overflow:hidden;
  border:1px solid #eee;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
}

.card--product-full .card__thumb img{
  width:100%;
  height:170px;
  object-fit:contain;
  background:#fff;
  display:block;
}

.card--product-full .card__thumb-ph{
  width:100%;
  height:170px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  font-weight:800;
  background:#f6f6f6;
}

.card--product-full .card__body{ display:flex; flex-direction:column; gap:6px; }
.card--product-full .card__title{ font-weight:900; line-height:1.2; }
.card--product-full .card__meta{ font-size:12px; color:var(--muted); }
.card--product-full .card__price{ font-size:18px; font-weight:900; margin-top:4px; }
.card--product-full .card__footer{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-top:6px;
}
.card--product-full .card__point{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:60%;
}

/* COMPACT card */
.card--product-compact{
  padding:12px 14px;
  display:grid;
  grid-template-columns: 110px 1fr auto;
  gap:14px;
  align-items:center;
}

.compact__thumb{
  border-radius: var(--r14);
  overflow:hidden;
  border:1px solid #eee;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
}

.compact__thumb img{
  width:100%;
  height:92px;
  object-fit:cover;
  display:block;
}

.compact__thumb-ph{
  width:100%;
  height:92px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  font-weight:800;
  background:#f6f6f6;
}

.compact__left{ min-width:0; }

.compact__title{
  font-weight:900;
  line-height:1.2;
  font-size:16px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.compact__meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:6px;
  align-items:center;
}

.compact__kit{
  font-size:12px;
  color:var(--muted);
  border:1px dashed rgba(0,0,0,.18);
  padding:4px 8px;
  border-radius: var(--r999);
  background:#fff;
  max-width: 720px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.compact__right{
  display:flex;
  align-items:center;
  gap:12px;
  flex-shrink:0;
}

.compact__price{
  font-size:20px;
  font-weight:900;
  white-space:nowrap;
}

@media (max-width:900px){
  .card--product-compact{
    grid-template-columns: 110px 1fr;
    grid-template-areas:
      "thumb left"
      "right right";
  }
  .compact__thumb{ grid-area: thumb; }
  .compact__left{ grid-area: left; }
  .compact__right{
    grid-area: right;
    width:100%;
    justify-content:space-between;
  }
  .compact__kit{ max-width:100%; }
}

/* -------------------- Admin forms -------------------- */

.form-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
  margin-top:6px;
}
.form-row{ display:flex; flex-direction:column; }
.form-label{ font-weight:900; font-size:13px; margin-bottom:6px; }

.input{
  padding:10px 12px;
  border:1px solid #ddd;
  border-radius: var(--r12);
  background:#fff;
  font-size:14px;
}
.input:focus{
  outline: 2px solid rgba(214,0,0,.25);
  outline-offset: 2px;
}

@media (max-width:900px){
  .form-grid{ grid-template-columns: 1fr; }
}

/* -------------------- Mobile bottom bar (public only) -------------------- */

.mobilebar{ display:none; }

@media (max-width:900px){
  body{ padding-bottom: 74px; } /* чтобы контент не закрывался панелью */

  .mobilebar{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    z-index:9999;
    display:flex;
    gap:10px;
    padding:10px 12px;
    background:#fff;
    border-top:1px solid rgba(0,0,0,.08);
    box-shadow: 0 -14px 34px rgba(0,0,0,.08);
  }

  .mobilebar__btn{
    flex:1;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    height:52px;
    border-radius:16px;
    border:1px solid var(--border);
    background:#fff;
    font-weight:900;
    font-size:14px;
    white-space:nowrap;
    user-select:none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobilebar__btn--call{
    border-color: rgba(214,0,0,.22);
  }

  .mobilebar__ico{ font-size:18px; }

  .mobilebar__svg{
    width:18px;
    height:18px;
    fill: currentColor;
    display:block;
  }

  /* цвета по aria-label */
  .mobilebar__btn[aria-label="Telegram"]{ color:#229ED9; }
  .mobilebar__btn[aria-label="MAX"]{ color:#111; }

  .mobilebar__dot{
    width:8px;
    height:8px;
    border-radius:999px;
    background:#22c55e;
    box-shadow: 0 0 0 4px rgba(34,197,94,.18);
    animation: mobilebarPulse 1.2s ease-in-out infinite;
  }

  @keyframes mobilebarPulse{
    0%{ transform: scale(1); opacity:1; }
    50%{ transform: scale(1.15); opacity:.85; }
    100%{ transform: scale(1); opacity:1; }
  }
}
/* ===== Buyback page ===== */

.page-head{
  margin-top:18px;
}
.page-title{
  margin:0;
  font-size:34px;
  letter-spacing:-.3px;
}
.page-subtitle{
  margin:8px 0 0;
  font-size:14px;
}

.notice{
  margin-top:14px;
  border-radius: var(--r16);
  border:1px solid rgba(0,0,0,.08);
  background:#fff;
  box-shadow: var(--shadow);
  padding:12px 14px;
  display:flex;
  align-items:flex-start;
  gap:12px;
}
.notice__icon{
  width:34px;
  height:34px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.25);
}
.notice__title{
  font-weight:900;
  margin-bottom:2px;
}
.notice__text{
  font-size:13px;
  color: var(--muted);
  line-height:1.35;
}
.notice--ok{
  border-color: rgba(34,197,94,.25);
}

.bb{
  margin-top:14px;
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap:14px;
  align-items:start;
}

.bb__card{
  padding:14px;
}

.bb__grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}

.bb__field{ display:flex; flex-direction:column; gap:6px; }
.bb__field--full{ grid-column: 1 / -1; }

.bb__label{
  font-weight:900;
  font-size:13px;
}

.bb__textarea{
  width:100%;
  min-height:120px;
  padding:10px 12px;
  border:1px solid #ddd;
  border-radius: var(--r12);
  background:#fff;
  font-size:14px;
  resize: vertical;
}
.bb__textarea:focus{
  outline: 2px solid rgba(214,0,0,.25);
  outline-offset: 2px;
}

.bb__agree{
  display:flex;
  align-items:flex-start;
  gap:10px;
  font-size:12px;
  color: var(--muted);
  line-height:1.35;
  user-select:none;
}
.bb__check{
  margin-top:2px;
  width:16px;
  height:16px;
  accent-color: var(--red);
}

.bb__actions{
  margin-top:12px;
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.bb__submit{
  border-radius: var(--r16);
  padding:12px 16px;
}

.bb__hint{
  font-size:12px;
}

.bb__infoTitle{
  font-weight:900;
  font-size:16px;
}
.bb__steps{
  margin:10px 0 0 18px;
  padding:0;
  color:#222;
  font-size:13px;
  line-height:1.5;
}
.bb__mini{
  margin-top:10px;
  font-size:12px;
}

@media (max-width:900px){
  .page-title{ font-size:26px; }
  .bb{ grid-template-columns: 1fr; }
  .bb__grid{ grid-template-columns: 1fr; }
}
.lead-card:hover{
  border-color: rgba(214,0,0,.22);
}
/* ===== Lead message formatting ===== */
.lead-msg{
  margin-top:10px;
  border:1px solid rgba(0,0,0,.08);
  border-radius:16px;
  background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
  padding:12px 12px;
}

.lead-msg__title{
  font-weight:900;
  font-size:16px;
  line-height:1.25;
}

.lead-msg__meta{
  margin-top:8px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.lead-msg__chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.10);
  background:#fff;
  font-size:12px;
  font-weight:900;
  color:#111;
}

.lead-msg__chip--price{
  border-color: rgba(214,0,0,.22);
  box-shadow: 0 0 0 4px rgba(214,0,0,.06);
}

.lead-msg__chip--state{
  border-color: rgba(0,0,0,.14);
}

.lead-msg__note{
  margin-top:10px;
  padding-top:10px;
  border-top:1px dashed rgba(0,0,0,.12);
  white-space:pre-wrap;
  font-size:13px;
  color:#222;
  line-height:1.35;
}
/* ===== Analytics UI polish ===== */

.page-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:16px;
  margin:18px 0 12px;
}
.page-title{
  margin:0;
  font-size:32px;
  letter-spacing:-0.2px;
}
.page-subtitle{
  margin-top:6px;
  color:rgba(0,0,0,.55);
  font-size:14px;
}

.card--pad{ padding:12px; }

.filters-grid{
  display:grid;
  grid-template-columns:repeat(6, minmax(0, 1fr));
  gap:10px;
  align-items:end;
}
.field .label{
  color:rgba(0,0,0,.55);
  font-size:12px;
  margin-bottom:6px;
}
.filters-actions{
  margin-top:12px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.filters-hint{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:8px;
  color:rgba(0,0,0,.5);
  font-size:12px;
}
.hint-dot{
  width:8px;height:8px;border-radius:99px;
  background:rgba(0,0,0,.2);
  display:inline-block;
}

.kpi-grid{
  margin-top:14px;
  display:grid;
  grid-template-columns:repeat(6, minmax(0, 1fr));
  gap:12px;
}
.kpi{
  border:1px solid rgba(0,0,0,.08);
  border-radius:14px;
  padding:12px;
  background:#fff;
}
.kpi-top{
  display:flex;
  align-items:center;
  gap:10px;
}
.kpi-ico{
  font-size:18px;
  width:28px;height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  background:rgba(0,0,0,.04);
}
.kpi-title{
  color:rgba(0,0,0,.6);
  font-size:12px;
}
.kpi-value{
  margin-top:10px;
  font-size:24px;
  font-weight:800;
  letter-spacing:-0.2px;
}
.kpi-sub{
  margin-top:4px;
  font-size:12px;
  color:rgba(0,0,0,.5);
}

.card-head{ margin-bottom:10px; }
.card-title{
  font-weight:800;
  font-size:16px;
  margin:0;
}
.card-subtitle{
  margin-top:6px;
  color:rgba(0,0,0,.55);
  font-size:13px;
}

.table-wrap{ overflow:auto; }
.table--compact th,
.table--compact td{ padding:10px 10px; vertical-align:top; }
.small{ font-size:12px; }

.cell-title .title-row{
  display:flex;
  align-items:baseline;
  gap:8px;
  flex-wrap:wrap;
}
.link{
  color:inherit;
  text-decoration:none;
  border-bottom:1px dashed rgba(0,0,0,.25);
}
.link:hover{ border-bottom-color: rgba(0,0,0,.6); }

.grid-3{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:12px;
}

/* responsive */
@media (max-width: 1100px){
  .filters-grid{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
  .kpi-grid{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
  .grid-3{ grid-template-columns:1fr; }
}
@media (max-width: 640px){
  .filters-grid{ grid-template-columns:1fr; }
  .kpi-grid{ grid-template-columns:1fr; }
}
/* ===== Unified badges (admin) ===== */

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  line-height:1;
  white-space:nowrap;
  border:1px solid rgba(0,0,0,.10);
  background:#fff;
}

/* dot */
.badge::before{
  content:"";
  width:7px;
  height:7px;
  border-radius:99px;
  background: rgba(0,0,0,.22);
  flex:0 0 auto;
}

/* --- Status badges --- */
.badge-status--new{
  background: rgba(255, 193, 7, .18);
  border-color: rgba(255, 193, 7, .40);
}
.badge-status--new::before{ background: rgba(255,193,7,.95); }

.badge-status--in_work{
  background: rgba(13, 110, 253, .16);
  border-color: rgba(13, 110, 253, .40);
}
.badge-status--in_work::before{ background: rgba(13,110,253,.95); }

.badge-status--done{
  background: rgba(25, 135, 84, .16);
  border-color: rgba(25, 135, 84, .36);
}
.badge-status--done::before{ background: rgba(25,135,84,.95); }

.badge-status--rejected{
  background: rgba(220, 53, 69, .16);
  border-color: rgba(220, 53, 69, .36);
}
.badge-status--rejected::before{ background: rgba(220,53,69,.95); }

/* --- Type badges --- */
.badge-type--buyback{
  background: rgba(220, 53, 69, .10);
  border-color: rgba(220, 53, 69, .24);
}
.badge-type--buyback::before{ background: rgba(220,53,69,.95); }

.badge-type--availability{
  background: rgba(13, 110, 253, .10);
  border-color: rgba(13, 110, 253, .24);
}
.badge-type--availability::before{ background: rgba(13,110,253,.95); }

.badge-type--reserve{
  background: rgba(255, 193, 7, .14);
  border-color: rgba(255, 193, 7, .30);
}
.badge-type--reserve::before{ background: rgba(255,193,7,.95); }

.badge-type--call{
  background: rgba(108, 117, 125, .12);
  border-color: rgba(108, 117, 125, .26);
}
.badge-type--call::before{ background: rgba(108,117,125,.95); }

.badge-type--order{
  background: rgba(32, 201, 151, .14);
  border-color: rgba(32, 201, 151, .28);
}
.badge-type--order::before{ background: rgba(32,201,151,.95); }


* ===== unified badges ===== */
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:12px;
  line-height:1;
  border:1px solid rgba(0,0,0,.08);
  background:#fff;
  white-space:nowrap;
}
.badge__ico{ font-size:12px; opacity:.9; }

.badge--type{ border-color: rgba(0,0,0,.10); }
.badge--type-buyback{ background: rgba(255,0,0,.08); border-color: rgba(255,0,0,.18); }
.badge--type-availability{ background: rgba(30,90,200,.08); border-color: rgba(30,90,200,.18); }
.badge--type-reserve{ background: rgba(180,120,0,.10); border-color: rgba(180,120,0,.22); }
.badge--type-call{ background: rgba(0,0,0,.06); border-color: rgba(0,0,0,.12); }
.badge--type-order{ background: rgba(0,150,0,.08); border-color: rgba(0,150,0,.18); }

.badge--status-new{ background: rgba(30,90,200,.10); border-color: rgba(30,90,200,.22); }
.badge--status-in_work{ background: rgba(180,120,0,.10); border-color: rgba(180,120,0,.22); }
.badge--status-done{ background: rgba(0,150,0,.10); border-color: rgba(0,150,0,.22); }
.badge--status-rejected{ background: rgba(255,0,0,.10); border-color: rgba(255,0,0,.22); }

.nav{display:flex;gap:10px;align-items:center}
.nav__link{
  display:inline-flex;align-items:center;gap:8px;
  padding:10px 12px;border-radius:14px;
  text-decoration:none;font-weight:900;
  border:1px solid rgba(0,0,0,.08);
  background:rgba(0,0,0,.03);
  color:#111;
}
.nav__link:hover{background:rgba(0,0,0,.06)}
.nav__link.is-active{background:#111;color:#fff;border-color:#111}
.nav__link--primary{background:rgba(255,0,0,.08);border-color:rgba(255,0,0,.18)}
.nav__link--primary:hover{background:rgba(255,0,0,.12)}
.nav__ico{font-size:14px;line-height:1}

/* чтобы ничего не вылезало за ширину */
html, body { overflow-x: hidden; }

/* NAV: на мобилке прячем */
@media (max-width: 900px){
  .nav--desktop { display: none !important; }
}

/* mobilebar: всегда фикс снизу */
.mobilebar{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,.96);
  border-top: 1px solid rgba(0,0,0,.08);
  backdrop-filter: blur(10px);
}

/* кнопки внутри */
.mobilebar__btn{
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: #111;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 14px;
  padding: 10px 10px;
  font-weight: 900;
  background: #fff;
  min-height: 44px;
}

.mobilebar__svg{ width: 18px; height: 18px; display:block; }

/* важно: чтобы контент не залезал под fixed-панель */
@media (max-width: 900px){
  body{ padding-bottom: 80px; } /* подгони 70-90px под высоту панели */
}

/* на ПК скрываем mobilebar (если у тебя уже было — можно оставить) */
@media (min-width: 901px){
  .mobilebar{ display: none; }
}