/* Общие стили экранов кабинета и админки: заголовок страницы, история (фильтры, период, панель «Примерка»), график. Размеры — по макетам Figma
   «POS account» (317:26, 319:39, 269:226, 271:237) и «Admin» (216:3, 239:101, 268:216). */

/* ---------- обзор: заголовок ---------- */
.op-ovh { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.op-ovh__t { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.op-ovh__m { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; color: var(--color-text-secondary); }
.op-ovh__m i { font-style: normal; color: var(--gray-400); }
.op-site { display: inline-flex; align-items: center; gap: 6px; color: var(--color-text-primary); text-decoration: underline; text-underline-position: from-font; }
.op-st { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 10px; border-radius: var(--radius-full); background: #fff; font-size: var(--ui-label-size); line-height: var(--ui-label-line-height); font-weight: 500; white-space: nowrap; }
.op-st--mute { color: var(--gray-500); gap: 6px; }
.op-st svg { flex: none; }
.op-mis { display: inline-flex; gap: 6px; }
.op-mi { width: 28px; height: 28px; border-radius: 50%; background: #fff; display: inline-flex; align-items: center; justify-content: center; }
.op-btn-w { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px 0 16px; border: 0; border-radius: var(--radius-full); background: #fff; font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--color-text-primary); }
.op-btn-w--sm { padding: 0 20px 0 16px; }
.op-btn-w[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; }

.op-reportpill {
  position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); z-index: 4; display: inline-flex; align-items: center; gap: 12px; padding: 12px 24px 12px 12px;
  border-radius: var(--radius-full); background: var(--gray-950); color: #fff; font-size: 16px; line-height: 24px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); white-space: nowrap; max-width: calc(100% - 32px);
}
.op-reportpill--fixed { position: fixed; top: auto; bottom: 28px; transform: translateX(-50%); transition: opacity var(--dur-medium); }
.op-reportpill--fixed.is-gone { opacity: 0; pointer-events: none; }


/* ---------- история ---------- */
.op-hh { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.op-hh__t { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.op-hh__r { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.op-search { display: flex; align-items: center; gap: 10px; width: 310px; max-width: 100%; height: 44px; padding: 0 16px; border-radius: var(--radius-full); background: #fff; color: #a1a1aa; font-size: 16px; white-space: nowrap; overflow: visible; cursor: not-allowed; }
.op-search span { overflow: hidden; text-overflow: ellipsis; }
.op-hf__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; position: relative; }
.op-hf__row--st { margin-top: 16px; gap: 8px; }
.op-hf__row--st > .op-sub { margin-right: 4px; font-size: 14px; }
.op-hf { margin-bottom: 24px; }
.op-hf__per { position: relative; }
.op-fp { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 16px; border: 0; border-radius: var(--radius-full); background: #fff; font-size: 14px; line-height: 20px; color: var(--gray-500); white-space: nowrap; }
.op-fp b { font-weight: 600; color: var(--color-text-primary); }
.op-fp select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.op-fp--dark { background: var(--gray-950); color: #fff; font-weight: 600; padding-left: 14px; }
.op-fp--dark b { color: #fff; }
.op-fp--dark span { font-weight: 600; }
.op-sf { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 14px; border: 0; border-radius: var(--radius-full); background: #fff; font-size: 14px; font-weight: 500; }
.op-sf.is-on { background: var(--gray-950); color: #fff; }
.op-hist--full { padding: 24px; }
.op-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.op-pop { position: absolute; z-index: 40; left: 0; top: calc(100% + 8px); width: 860px; max-width: calc(100vw - 48px); background: #fff; border-radius: 20px; box-shadow: var(--shadow-popup); }
.op-pop__body { display: flex; }
.op-pop__list { list-style: none; margin: 0; padding: 16px 8px 16px 16px; width: 200px; flex: none; border-right: 1px solid var(--color-border-default); display: flex; flex-direction: column; gap: 4px; }
.op-pop__list button { width: 100%; text-align: left; border: 0; background: none; padding: 10px 14px; border-radius: 12px; font-size: 14px; color: var(--gray-500); }
.op-pop__list button.is-on { background: var(--gray-100); color: var(--color-text-primary); font-weight: 600; }
.op-pop__cals { position: relative; flex: 1; display: flex; gap: 32px; padding: 16px 32px 24px; min-width: 0; }
.op-pop__nav { position: absolute; top: 14px; width: 28px; height: 28px; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; }
.op-pop__nav--l { left: 8px; } .op-pop__nav--r { right: 8px; }
.op-cal { flex: 1; min-width: 0; }
.op-cal__t { text-align: center; font-size: 16px; font-weight: 600; line-height: 28px; margin-bottom: 12px; }
.op-cal__g { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; }
.op-cal__w { text-align: center; font-size: 12px; color: var(--gray-500); height: 28px; line-height: 28px; }
.op-cal__d { height: 36px; border: 0; background: none; font-size: 14px; font-weight: 500; text-align: center; line-height: 36px; padding: 0; position: relative; border-radius: 50%; color: var(--color-text-primary); }
.op-cal__d.is-dis { color: var(--gray-400); font-weight: 400; }
.op-cal__d.is-in { background: var(--gray-100); border-radius: 0; }
.op-cal__d.is-end { background: var(--gray-950); color: #fff; }
.op-cal__d.is-today:not(.is-end) { outline: 1px dashed var(--gray-950); outline-offset: -3px; }
.op-pop__foot { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--color-border-default); flex-wrap: wrap; }
.op-pop__in { background: var(--gray-100); border-radius: 10px; padding: 8px 14px; font-size: 14px; font-weight: 500; }
.op-pop__sp { flex: 1; }

/* ---------- панель «Примерка» ---------- */
.op-dr { display: flex; flex-direction: column; min-height: 100%; }
.op-dr__h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.op-dr__img { width: 100%; aspect-ratio: 432 / 320; border-radius: 20px; background-color: var(--gray-100); background-repeat: no-repeat; }
.op-dr__img--none { display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--color-text-secondary); }
.op-dr__chips { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.op-dr__chip { display: inline-flex; align-items: center; gap: 12px; padding: 6px 16px 6px 6px; border-radius: 16px; background: var(--gray-100); font-size: 14px; font-weight: 500; }
.op-dr__chip .op-thumb { width: 32px; height: 32px; border-radius: 8px; }
.op-dr__kvs { margin-top: 16px; }
.op-dr__kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--color-border-default); color: var(--color-text-secondary); }
.op-dr__kv span:last-child { color: var(--color-text-primary); text-align: right; }
.op-dr__ev { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.op-dr__ev li { display: flex; align-items: flex-start; gap: 12px; }
.op-dr__ev time { width: 40px; flex: none; color: var(--color-text-secondary); font-size: 14px; line-height: 28px; }
.op-dr__ev .op-dot { margin-top: 10px; }
.op-dr__ev small { display: block; color: var(--color-text-secondary); font-size: 13px; line-height: 18px; }
.op-dr__act { display: flex; gap: 12px; margin-top: auto; padding-top: 24px; flex-wrap: wrap; }
.op-btn--dark { background: var(--gray-950); color: #fff; }
.op-btn--block { width: 100%; justify-content: center; height: 52px; }

/* ---------- ширины ---------- */
@media (max-width: 1320px) {
  .op-table--ov .op-tr, .op-table--aov .op-tr { grid-template-columns: 160px minmax(130px, 200px) 120px minmax(0, 1fr) 168px; }
  .op-table--hi .op-tr { grid-template-columns: 110px 130px 140px 150px minmax(0, 1fr) 168px; }
  .op-table--ahi .op-tr { grid-template-columns: 110px 120px 130px 170px minmax(0, 1fr) 168px; }
}
@media (max-width: 1180px) {
  .op-main { padding: 28px 28px 48px; }
}

/* ---------- телефон ---------- */
@media (max-width: 720px) {
  .op-top { height: auto; min-height: var(--topbar-h); flex-wrap: wrap; padding: 10px 16px; gap: 8px 10px; }
  .op-demo { height: 24px; padding: 0 10px; font-size: 11px; }
  .op-top__right { width: 100%; margin-left: 0; gap: 8px; justify-content: space-between; }
  .op-exit { font-size: 14px; }
  .op-side { position: static; width: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--color-border-default); overflow-x: auto; }
  .op-nav { flex-direction: row; gap: 2px; }
  .op-nav a { height: 40px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
  .op-main { margin-left: 0; padding: 20px 16px 40px; }
  .op-h1 { font-size: 24px; line-height: 32px; }
  .op-card { padding: 20px 16px; border-radius: 16px; }
  .op-ovh { margin-bottom: 20px; align-items: flex-start; }
  .op-ovh__m { gap: 8px 12px; }
  .op-chart__body { height: 260px; margin-top: 20px; }
  .op-chart__ctl { width: 100%; }
  .op-reportpill { white-space: normal; text-align: left; }
  /* таблицы → карточки */
  .op-table .op-tr--head { display: none; }
  .op-table .op-tr { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; padding: 14px 0; }
  .op-table .op-c { padding-right: 0; }
  .op-c--time { grid-column: 1; grid-row: 1; font-size: 14px; }
  .op-table--ov .op-c--method, .op-table--hi .op-c--method, .op-table--aov .op-c--point, .op-table--ahi .op-c--point { grid-column: 1; grid-row: 2; }
  .op-table--ov .op-c--kind, .op-table--hi .op-c--kind, .op-table--aov .op-c--kind { grid-column: 2; grid-row: 1; font-size: 14px; text-align: right; }
  .op-table--ahi .op-c--method { grid-column: 2; grid-row: 1; font-size: 14px; text-align: right; }
  .op-table--hi .op-c--niche, .op-table--ahi .op-c--niche { grid-column: 2; grid-row: 2; font-size: 14px; text-align: right; color: var(--color-text-secondary); }
  .op-table .op-c--status { grid-column: 1 / -1; grid-row: 3; }
  .op-table .op-c--thumbs { grid-column: 1 / -1; grid-row: 4; }
  .op-thumbs { justify-content: flex-start; }
  .op-row { min-height: 0; }
  .op-hh__r { width: 100%; }
  .op-search { width: 100%; }
  .op-pop { position: fixed; left: 12px; right: 12px; top: 80px; width: auto; max-height: calc(100vh - 100px); overflow-y: auto; }
  .op-pop__body { flex-direction: column; }
  .op-pop__list { width: auto; border-right: 0; border-bottom: 1px solid var(--color-border-default); flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .op-pop__list button { padding: 8px 12px; }
  .op-pop__cals { flex-direction: column; padding: 12px 16px; gap: 16px; }
  .op-pop__nav { top: 6px; }
  .op-pop__nav--l { left: 4px; } .op-pop__nav--r { right: 4px; }
  .op-foot { justify-content: center; }
  .op-pager { gap: 2px; }
  .op-pg { width: 36px; height: 36px; }
  .op-hist--full { padding: 12px 16px; }
  .op-ov--modal { padding: 0; align-items: flex-end; }
  .op-ov--modal .op-ov__box { border-radius: 24px 24px 0 0; padding: 24px 16px; max-height: 94vh; }
  .op-ov--drawer .op-ov__box { width: 100%; padding: 20px 16px; }
  .op-row2 { grid-template-columns: minmax(0, 1fr); }
  .op-toast, .op-reportpill--fixed { bottom: 16px; }
}

/* ---------- многострочное поле ---------- */
.op-ta { width: 100%; min-height: 168px; resize: vertical; border: 0; border-radius: 12px; background: var(--gray-100); padding: 14px 16px; font-size: 16px; line-height: 28px; font-family: inherit; }
.op-ta:focus { outline: 2px solid var(--gray-950); }

/* пустое состояние «этого у API ещё нет» */
.op-unavail { text-align: center; padding: 56px 24px; }
.op-unavail .op-sub { margin: 8px auto 0; max-width: 420px; }

/* ---------- фото примерок админки (shared/media.js) ---------- */
button.op-thumb { border: 0; padding: 0; font: inherit; cursor: zoom-in; }
.op-thumb--media { background-size: cover; background-position: 50% 50%; }
.op-thumb--media:focus-visible, .op-dr__img--media:focus-visible { outline: 2px solid var(--gray-950); outline-offset: 2px; }
.op-thumb--media.is-ok > svg { display: none; }
.op-thumb--media.is-load::after, .op-dr__img--media.is-load::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  transform: translateX(-100%); animation: op-shimmer 1.2s ease-in-out infinite;
}
@keyframes op-shimmer { to { transform: translateX(100%); } }
.op-thumb--media.is-err { cursor: pointer; color: #b42318; background-color: #fef3f2; }
.op-thumb--media.is-err > svg { display: none; }
.op-thumb--media.is-err::before { content: '!'; font-weight: 700; font-size: 18px; }
.op-thumb--deleted { font-size: 9px; line-height: 1; font-weight: 500; text-align: center; color: var(--gray-500); border: 1px dashed var(--gray-400); background: #fff; }
.op-dr__chip .op-thumb--deleted { font-size: 8px; }
.op-dr__img--media { position: relative; display: flex; align-items: center; justify-content: center; border: 0; padding: 0; overflow: hidden; cursor: zoom-in; background-size: cover; background-position: 50% 50%; color: var(--gray-400); }
.op-dr__img--media.is-ok .op-dr__ph { display: none; }
.op-dr__img--media.is-err { cursor: pointer; background-color: #fef3f2; color: #b42318; }
.op-dr__note { margin: 12px 0 0; font-size: 13px; line-height: 18px; color: var(--color-text-secondary); }
@media (prefers-reduced-motion: reduce) { .op-thumb--media.is-load::after, .op-dr__img--media.is-load::after { animation: none; } }

/* крупный просмотр фото (поверх панели «Примерка») */
.op-lb { position: fixed; inset: 0; z-index: 120; background: rgba(24, 24, 27, 0.86); display: flex; align-items: center; justify-content: center; padding: 56px 16px 24px; }
.op-lb__box { max-width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.op-lb__stage { display: flex; align-items: center; justify-content: center; min-width: 200px; min-height: 120px; }
.op-lb__img { display: block; max-width: 100%; max-height: calc(100vh - 150px); border-radius: 12px; background: #fff; object-fit: contain; }
.op-lb__wait { color: rgba(255, 255, 255, 0.8); font-size: 15px; }
.op-lb__cap { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; color: #fff; font-size: 14px; line-height: 20px; }
.op-lb__cap span { color: rgba(255, 255, 255, 0.7); font-size: 13px; }
.op-lb__x { position: fixed; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.op-lb__x:hover { background: rgba(255, 255, 255, 0.24); }
.op-lb__x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.op-thumb--off { color: var(--gray-400); background: var(--gray-100); font-size: 18px; cursor: help; }
.ad-media-off { margin: 0 0 12px; padding: 10px 16px; border-radius: 12px; background: var(--gray-100); color: var(--color-text-secondary); font-size: 14px; line-height: 20px; }
