/* Стили вкладок апсейл/баннеры/статистика (PLAN пункт 13). */

.adm-row{ display:flex; align-items:center; gap:10px; }
.adm-row--between{ justify-content:space-between; }
.adm-muted{ color:var(--cr2-muted); font-size:13px; }
.adm-mb{ margin-bottom:12px; }

.adm-form label{
  display:block; font-size:13px; font-weight:600; color:var(--cr2-ink-soft);
  margin:0 0 6px 4px;
}
.adm-form .adm-field-wrap{ margin-bottom:12px; }
.adm-form input, .adm-form select, .adm-form textarea{ background:var(--cr2-surface-2); }

/* тумблер active */
.adm-toggle{
  width:46px; height:28px; flex:0 0 46px; border-radius:999px;
  background:var(--cr2-muted-2); position:relative; transition:background .15s;
}
.adm-toggle::after{
  content:""; position:absolute; top:3px; left:3px;
  width:22px; height:22px; border-radius:50%; background:#fff;
  transition:transform .15s;
}
.adm-toggle--on{ background:var(--cr2-success); }
.adm-toggle--on::after{ transform:translateX(18px); }

/* чипы выбранных предложений апсейла */
.adm-chips{ display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.adm-chip{
  display:inline-flex; align-items:center; gap:6px;
  background:var(--cr2-surface-2); color:var(--cr2-ink);
  border-radius:999px; padding:6px 10px; font-size:13px; font-weight:500;
}
.adm-chip button{ color:var(--cr2-muted); font-weight:700; line-height:1; }

.adm-danger{ color:var(--cr2-danger); font-weight:600; font-size:13px; }
.adm-linkbtn{ color:var(--cr2-accent); font-weight:600; font-size:14px; min-height:36px; }

/* ---------- вкладка «Апсейл» ---------- */
.adm-upsell-page-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin:0 4px 18px;
}
.adm-upsell-page-head h1{
  margin:0;
  font-size:27px;
  line-height:1.15;
  letter-spacing:-.03em;
}
.adm-upsell-page-head p{
  margin:5px 0 0;
  color:var(--cr2-muted);
  font-size:13px;
}
.adm-upsell-page-head > span{
  padding:6px 10px;
  border-radius:999px;
  background:#fff;
  color:var(--cr2-muted);
  font-size:12px;
  border:1px solid var(--cr2-line);
}
.adm-upsell-form{
  max-width:920px;
  margin:0 auto 18px;
  padding:24px;
  border:1px solid var(--cr2-line);
  border-radius:18px;
  box-shadow:0 3px 14px rgba(31,49,67,.035);
}
.adm-upsell-form-head{
  padding-bottom:16px;
  border-bottom:1px solid var(--cr2-line);
  font-size:18px;
}
.adm-upsell-field{
  margin-bottom:15px;
}
.adm-upsell-field label,
.adm-upsell-suggestions > label{
  display:block;
  margin:0 0 7px 2px;
  color:var(--cr2-ink-soft);
  font-size:12px;
  font-weight:700;
}
.adm-upsell-form input,
.adm-upsell-form select{
  min-height:46px;
  height:46px;
  padding:0 13px;
  border:1px solid #e0e6ea;
  border-radius:11px;
  background:#f7f9fa;
  font-size:14px;
}
.adm-upsell-form select:disabled{
  opacity:.58;
  color:var(--cr2-muted);
}
.adm-upsell-suggestions{
  margin:4px 0 18px;
  padding:16px;
  border:1px solid #e1e5ff;
  border-radius:14px;
  background:#f8f8ff;
}
.adm-upsell-add-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 156px;
  gap:9px;
  align-items:center;
}
.adm-upsell-add-row--item{
  grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr) 150px;
}
.adm-upsell-add-row .adm-linkbtn{
  min-height:42px;
  padding:0 12px;
  border:1px solid #dbe1ff;
  border-radius:10px;
  background:#fff;
  font-size:12px;
  white-space:nowrap;
}
.adm-upsell-suggestions .adm-chips{
  min-height:0;
  margin-top:11px;
}
.adm-upsell-suggestions .adm-chip{
  border:1px solid #dce2ff;
  background:#fff;
  color:#4152ca;
}
.adm-upsell-save{
  width:auto;
  min-width:210px;
  min-height:48px;
  margin:4px 0 0 auto;
  padding:0 25px;
  display:block;
  border-radius:11px;
  font-size:14px;
}
.adm-upsell-rule{
  max-width:920px;
  margin:0 auto 12px;
  padding:17px 19px;
  border:1px solid var(--cr2-line);
  border-radius:15px;
  box-shadow:0 3px 14px rgba(31,49,67,.03);
}
.adm-upsell-rule-head b{
  font-size:15px;
}
.adm-upsell-rule-meta{
  margin:-4px 0 11px;
  line-height:1.5;
}
.adm-upsell-rule-suggestions{
  padding:11px 13px;
  border-radius:11px;
  background:#f6f8fa;
  color:var(--cr2-ink-soft);
  font-size:13px;
}
.adm-upsell-delete{
  min-height:36px;
  padding:0 12px;
  border-radius:9px;
  background:#fff1f1;
}

@media (min-width:1100px){
  body[data-admin-tab=upsell] .adm-content{
    max-width:none;
    padding:26px 32px 50px;
  }
  body[data-admin-tab=upsell] .adm-upsell-form{
    max-width:none;
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:0 16px;
  }
  body[data-admin-tab=upsell] .adm-upsell-form-head{
    grid-column:1 / -1;
    margin-bottom:18px;
  }
  body[data-admin-tab=upsell] .adm-upsell-field{
    grid-column:span 2;
  }
  body[data-admin-tab=upsell] .adm-upsell-suggestions{
    grid-column:1 / -1;
  }
  body[data-admin-tab=upsell] .adm-upsell-field:nth-last-of-type(2){
    grid-column:span 4;
  }
  body[data-admin-tab=upsell] .adm-upsell-save{
    grid-column:1 / -1;
  }
  body[data-admin-tab=upsell] .adm-upsell-page-head,
  body[data-admin-tab=upsell] .adm-upsell-form,
  body[data-admin-tab=upsell] .adm-upsell-rule,
  body[data-admin-tab=upsell] .adm-content > .adm-muted{
    max-width:1120px;
  }
  body[data-admin-tab=upsell] .adm-upsell-page-head,
  body[data-admin-tab=upsell] .adm-content > .adm-muted{
    margin-left:auto;
    margin-right:auto;
  }
}

@media (max-width:760px){
  .adm-upsell-page-head{
    align-items:flex-start;
    flex-direction:column;
  }
  .adm-upsell-page-head h1{ font-size:22px; }
  .adm-upsell-form{ padding:18px 16px; }
  .adm-upsell-add-row,
  .adm-upsell-add-row--item{
    display:flex;
    align-items:stretch;
    flex-direction:column;
  }
  .adm-upsell-add-row .adm-linkbtn{ width:100%; }
  .adm-upsell-save{ width:100%; }
}

/* превью баннера */
.adm-banner-preview{
  width:100%; aspect-ratio:16/9; border-radius:16px; overflow:hidden;
  background:var(--cr2-surface-2); margin-bottom:10px;
  display:flex; align-items:center; justify-content:center;
}
.adm-banner-preview img{ width:100%; height:100%; object-fit:cover; }
.adm-banner-preview .adm-muted{ padding:20px; }

/* статистика */
.adm-stat-table{ width:100%; border-collapse:collapse; }
.adm-stat-table th, .adm-stat-table td{
  text-align:left; padding:9px 6px; border-bottom:1px solid var(--cr2-line);
  font-size:14px;
}
.adm-stat-table th{ color:var(--cr2-muted); font-weight:600; font-size:12px; }
.adm-stat-table td:last-child, .adm-stat-table th:last-child{ text-align:right; }
.adm-stat-big{ font-size:28px; font-weight:700; }

.adm-seg{ display:inline-flex; background:#DBE3E8; border-radius:999px; padding:4px; }
.adm-seg button{
  min-height:36px; padding:0 16px; border-radius:999px;
  font-weight:600; font-size:13px; color:var(--cr2-ink-soft);
}
.adm-seg button.adm-seg--on{ background:var(--cr2-accent); color:#fff; }

/* ---------- кадратор фото (cropper.js) ---------- */
.cr2crop-overlay{
  position:fixed; inset:0; z-index:1000;
  background:rgba(20,28,36,.72);
  display:flex; align-items:center; justify-content:center;
  padding:16px; overflow-y:auto;
  overscroll-behavior:contain;
}
.cr2crop-modal{
  width:100%; max-width:420px;
  max-height:calc(100dvh - 32px); overflow-y:auto;
  background:var(--cr2-surface); border-radius:var(--cr2-r-card);
  padding:18px 18px 16px;
  box-shadow:var(--cr2-shadow-float);
}
.cr2crop-title{
  font-size:16px; font-weight:700; color:var(--cr2-ink-soft);
  text-align:center; margin-bottom:8px;
}
.cr2crop-label{
  font-size:12px; line-height:1.35; color:var(--cr2-muted);
  text-align:center; margin:0 0 10px;
}
.cr2crop-stage{
  position:relative; width:min(86vw,360px); margin:0 auto;
  overflow:hidden; border-radius:18px;
  background:#0d141b; touch-action:none; cursor:grab;
  user-select:none; -webkit-user-select:none;
}
.cr2crop-stage:active{ cursor:grabbing; }
.cr2crop-img{
  position:absolute; top:0; left:0;
  transform-origin:0 0; max-width:none;
  pointer-events:none; user-select:none; -webkit-user-drag:none;
}
.cr2crop-grid{
  position:absolute; inset:0; pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px);
  background-size:33.33% 33.33%;
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.5);
}
.cr2crop-safezone{
  position:absolute; inset:20% 13% 22%;
  border:1.5px dashed rgba(255,255,255,.88); border-radius:12px;
  pointer-events:none; box-shadow:0 0 0 999px rgba(10,15,20,.08);
}
.cr2crop-safezone-label{
  position:absolute; left:50%; bottom:6px; transform:translateX(-50%);
  padding:3px 7px; border-radius:999px; white-space:nowrap;
  background:rgba(12,18,24,.66); color:#fff; font-size:10px; line-height:1;
}
.cr2crop-warning{
  font-size:12px; line-height:1.35; text-align:center;
  margin:9px 8px 0; color:var(--cr2-muted);
}
.cr2crop-warning--attention{ color:var(--cr2-danger); }
.cr2crop-zoom{
  display:flex; align-items:center; gap:12px; margin:14px 4px 4px;
}
.cr2crop-zoom-ic{
  font-size:20px; font-weight:600; color:var(--cr2-muted); width:16px; text-align:center;
}
.cr2crop-zoom input[type=range]{ flex:1 1 auto; min-height:auto; }
.cr2crop-actions{ display:flex; gap:10px; margin-top:14px; }
.cr2crop-btn{
  flex:1 1 0; min-height:50px; border-radius:999px;
  font-weight:600; font-size:15px;
}
.cr2crop-btn--ghost{ background:var(--cr2-surface-2); color:var(--cr2-ink-soft); }
.cr2crop-btn--cta{ background:var(--cr2-accent); color:#fff; }
.cr2crop-btn:active{ transform:scale(.98); }
.adm-m-recrop{ margin-top:8px; color:var(--cr2-ink-soft); }

/* ---------- вкладка «Точка» (часы работы) ---------- */
.adm-shop-dot{
  width:12px; height:12px; border-radius:50%;
  background:var(--cr2-danger); flex:0 0 12px;
}
.adm-shop-dot--open{ background:var(--cr2-success); }
.adm-shop-day{
  display:flex; align-items:center; gap:10px;
  padding:7px 0;
}
.adm-shop-day input[type=checkbox]{
  width:22px; height:22px; min-height:22px; flex:0 0 22px; padding:0;
  accent-color:var(--cr2-accent);
}
.adm-shop-day-name{ flex:1 1 auto; font-size:14px; font-weight:500; }
.adm-shop-day input[type=time]{
  width:106px; min-height:44px; padding:8px 10px; flex:0 0 auto;
}
.adm-shop-day--off .adm-shop-day-name{ color:var(--cr2-muted-2); }
.adm-field textarea{ background:var(--cr2-surface-2); resize:vertical; }

/* ---------- drag-and-drop категорий ---------- */
.adm-m-drag{
  flex:0 0 28px; width:28px; min-height:44px;
  display:flex; align-items:center; justify-content:center;
  font-size:18px; color:var(--cr2-muted-2);
  cursor:grab; touch-action:none; user-select:none; -webkit-user-select:none;
}
.adm-m-cat--drag{
  position:relative; z-index:10;
  box-shadow:var(--cr2-shadow-float);
  opacity:.92;
}
.adm-m-pv-label{
  position:absolute; left:0; right:0; bottom:0;
  background:rgba(32,48,60,.62); color:#fff;
  font-size:10px; font-weight:600; text-align:center;
  padding:2px 0; border-radius:0 0 14px 14px;
}

/* ---------- вкладка «Модификаторы» ---------- */
.adm-mod{ display:flex; align-items:flex-start; gap:12px; padding:12px 0; border-bottom:1px solid var(--cr2-line); }
.adm-mod:last-child{ border-bottom:none; }
.adm-mod-name{ flex:1 1 auto; min-width:0; }
.adm-mod-title{ font-size:15px; font-weight:600; }
.adm-mod--hidden .adm-mod-title{ color:var(--cr2-muted-2); }
.adm-mod-req{
  display:inline-block; margin-left:8px; padding:1px 8px; border-radius:999px;
  background:var(--cr2-danger); color:#fff; font-size:11px; font-weight:700;
  vertical-align:middle;
}
.adm-mod .adm-toggle{ margin-top:2px; }
.adm-mod-edit{ display:block; margin-top:8px; }
.adm-mod-edit span{ display:block; margin-bottom:4px; font-size:12px; }
.adm-mod-edit input{ min-height:44px; background:var(--cr2-surface-2); }

/* -- позиции внутри группы (индивидуальные добавки) + мини-редактор КБЖУ -- */
.adm-mod-items{ margin-top:10px; border-top:1px dashed var(--cr2-line); padding-top:8px; }
.adm-mod-item{ padding:8px 0; border-bottom:1px solid var(--cr2-line); }
.adm-mod-item:last-child{ border-bottom:none; }
.adm-mod-item-head{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.adm-mod-item-name{ font-size:14px; font-weight:500; flex:1 1 auto; min-width:0; }
.adm-mod-badge{
  display:inline-block; padding:1px 8px; border-radius:999px;
  background:var(--cr2-muted-2); color:var(--cr2-ink-soft); font-size:11px; font-weight:700;
}
.adm-mod-expand{
  color:var(--cr2-accent); font-weight:600; font-size:13px; min-height:32px;
}
.adm-mod-rename{ margin-top:8px; padding:10px; border-radius:12px; background:var(--cr2-surface-2); }
.adm-mod-rename .adm-mod-edit{ margin-top:0; }
.adm-mod-form{ margin-top:8px; padding:10px; border-radius:12px; background:var(--cr2-surface-2); }
.adm-mod-form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.adm-mod-form label{ display:block; font-size:12px; font-weight:600; color:var(--cr2-ink-soft); margin:0 0 4px 2px; }
.adm-mod-form input{ width:100%; min-height:40px; background:var(--cr2-surface); border-radius:8px; }
.adm-mod-form-full{ grid-column:1 / -1; }
.adm-mod-form-save{
  margin-top:10px; min-height:40px; padding:0 18px; border-radius:999px;
  background:var(--cr2-accent); color:#fff; font-weight:600; font-size:14px;
}
.adm-mod-form-save:disabled{ opacity:.5; }
.adm-mod-form-loading{ font-size:13px; color:var(--cr2-muted); padding:6px 0; }

/* ---------- вкладка «Приложение»: стартовое видео ---------- */
/* Превью в пропорции телефона, но не на весь экран бэкофиса: владельцу нужно
   оценить кадр, а не смотреть ролик целиком. */
.adm-welcome-preview{
  display:block; width:100%; max-width:240px;
  aspect-ratio:9/16; background:#C9BDB0;
  border-radius:12px; margin:0 0 12px;
}
.adm-welcome-actions{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.adm-welcome-actions .adm-cta{ width:auto; }
.adm-welcome-actions button:disabled{ opacity:.5; }
