.admin-tag {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  background: rgba(255, 255, 255, .12); padding: 3px 8px; border-radius: 6px; margin-left: 4px;
}
.admin-head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.admin-open { min-height: 38px; font-size: 14px; flex: none; padding: 0 14px; }
.save-state { font-size: 13px; color: rgba(255, 255, 255, .6); white-space: nowrap; }
@media (max-width: 560px) { .save-state { display: none; } }
.auth { display: grid; place-items: center; min-height: 60vh; }
.auth-card { width: min(400px, 100%); background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.auth-card h1 { font-size: 24px; font-weight: 800; }
.auth-card p { margin: 0; }
.auth-card code { background: var(--bg); padding: 1px 6px; border-radius: 4px; }
.admin .header-row { gap: 12px; }
.admin .logo { min-width: 0; }
.admin .logo > span:not(.logo-mark):not(.admin-tag) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .hide-sm, .admin-tag { display: none; } }
.admin-main { padding-top: 24px; padding-bottom: 64px; }
.muted { color: var(--muted); }
.small { font-size: 13px; margin: 0 0 10px; }

.btn-sm { min-height: 34px; padding: 0 14px; font-size: 14px; }
.btn-light { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-light:hover { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-danger-text { color: var(--danger); }
.icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.tabs { display: flex; gap: 4px; background: var(--surface); padding: 4px; border-radius: 999px; width: fit-content; box-shadow: var(--shadow); max-width: 100%; overflow-x: auto; }
.tab { border: 0; background: none; padding: 9px 18px; border-radius: 999px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tab.is-active { background: var(--ink); color: #fff; }

.panel { margin-top: 24px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head h1 { font-size: 28px; font-weight: 800; }
.panel-head p { margin: 4px 0 0; }

/* Список товаров */
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.prow {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px 16px; align-items: center;
  background: var(--surface); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow);
}
.prow.is-hidden { opacity: .6; }
.prow-thumb { width: 64px; height: 64px; border-radius: var(--radius-sm); background: var(--bg); display: grid; place-items: center; overflow: hidden; padding: 6px; }
.prow-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.prow-thumb .mat-svg { height: 100%; width: auto; }
.prow-info { display: flex; flex-direction: column; min-width: 0; }
.prow-info b { font-size: 16px; }
.prow-info span { color: var(--muted); font-size: 14px; }
.prow-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; grid-column: 1 / -1; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; grid-column: 1 / -1; font-size: 14px; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 40px; height: 24px; border-radius: 12px; background: #c9cbcf; position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--wa); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.switch em { font-style: normal; font-weight: 600; color: var(--muted); min-width: 64px; }
@media (min-width: 760px) {
  .prow { grid-template-columns: 64px 1fr auto auto; }
  .switch, .prow-actions { grid-column: auto; }
}

/* Формы */
.card-form { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
@media (min-width: 760px) { .card-form { padding: 28px; } }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; gap: 16px 20px; } .span-2 { grid-column: span 2; } }
.form-section { font-size: 17px; font-weight: 800; margin-top: 10px; grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--line); }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-actions { margin-top: 20px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 14px !important; }
.swatch-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.swatch-preview span { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.two-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.two-selects select { width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 10px 12px; font-size: 15px; }

.sets-editor { display: grid; gap: 8px; margin-bottom: 10px; }
.set-row { display: grid; grid-template-columns: 1fr 120px 30px; gap: 8px; align-items: center; }
.set-row input { width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 15px; background: var(--surface); min-width: 0; }
.set-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.photo-row { display: flex; gap: 16px; align-items: flex-start; background: var(--bg); border-radius: var(--radius); padding: 14px; }
.photo-preview { width: 110px; height: 110px; flex: none; border-radius: var(--radius-sm); background: #e6e4dd; display: grid; place-items: center; overflow: hidden; padding: 8px; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.photo-preview .mat-svg { height: 100%; width: auto; }
.photo-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* Окно редактирования */
.admin-modal { width: min(760px, calc(100% - 24px)); }
.admin-modal form { display: flex; flex-direction: column; max-height: calc(100vh - 24px); }
.pd-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px 24px; border-bottom: 1px solid var(--line); }
.pd-head h2 { font-size: 22px; font-weight: 800; }
.pd-body { padding: 20px 24px; overflow-y: auto; }
.pd-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--bg); }

/* Данные */
.info-box { background: var(--accent-soft); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 18px; }
.info-box p { margin: 6px 0 0; color: var(--ink-2); }
.data-actions { display: grid; gap: 14px; }
@media (min-width: 800px) { .data-actions { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .data-actions { grid-template-columns: repeat(4, 1fr); } }
.data-card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: flex-start; }
.data-card h3 { font-size: 17px; }
.data-card p { margin: 6px 0 16px; flex: 1; }
.storage-usage { margin-top: 14px; font-size: 14px; }
.set-row { grid-template-columns: 1fr 110px 30px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.set-row .set-kaspi-in { grid-column: 1 / -1; font-size: 13px; }
.set-meta { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.sets-editor { max-height: 420px; overflow-y: auto; }
.review-form { margin-bottom: 18px; }
.rrow { grid-template-columns: 1fr; }
.rrow select { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 7px 10px; background: var(--surface); max-width: 100%; }
.rrow a { color: var(--accent-hover); font-weight: 700; font-size: 14px; }
@media (min-width: 760px) { .rrow { grid-template-columns: 1fr 240px auto; } }
.set-seats { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--ink-2); }
.set-seats label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.set-seats input { width: 15px; height: 15px; accent-color: var(--accent); }

/* Наличие варианта: авто по Kaspi, «ожидается» или «снят с продажи» */
.set-stock { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.set-stock select { flex: 1 1 220px; max-width: 320px; min-height: 40px; border: 1.5px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; }
.field .hint { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }

/* Главная: фото первого экрана и блок «Рекомендуем» */
.hero-edit { display: grid; gap: 16px; }
@media (min-width: 760px) { .hero-edit { grid-template-columns: 1fr 1fr; } }
.hero-slot b { font-size: 15px; }
.hero-slot p { margin: 4px 0 10px; }
.hero-pick { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); display: grid; place-items: center; cursor: crosshair; border: 1.5px solid var(--line); }
.hero-pick.is-empty { cursor: default; }
.hero-pick img { width: 100%; height: 100%; object-fit: cover; }
.focus-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 3px solid #fff; background: var(--accent); box-shadow: 0 0 0 2px rgba(0,0,0,.25); pointer-events: none; }
.hero-slot-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.preview-stage { margin-top: 14px; }
.preview-frame { max-width: 100%; border-radius: var(--radius-sm); overflow: hidden; border: 1.5px solid var(--line); background: var(--bg); display: grid; place-items: center; }
.preview-frame img { width: 100%; height: 100%; object-fit: cover; }
.feat-row { display: grid; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.feat-row:first-child { border-top: 0; }
.feat-row select { min-height: 44px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 0 10px; background: #fff; min-width: 0; }
.feat-actions { display: flex; gap: 4px; }
.feat-warn { grid-column: 1 / -1; margin: 0; padding: 8px 12px; border-radius: var(--radius-sm); background: #fdebed; color: #8c1420; font-size: 13px; font-weight: 600; }
.feat-note { grid-column: 1 / -1; margin: 0; }
@media (min-width: 860px) { .feat-row { grid-template-columns: 1.2fr 1.6fr 160px auto; } }

/* Статистика переходов */
.stats-top { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
@media (min-width: 760px) { .stats-top { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .stats-top { grid-template-columns: repeat(6, 1fr); } }
.stat-box { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat-box b { display: block; font-size: 24px; font-weight: 800; }
.stat-box span { color: var(--muted); font-size: 13px; }
.stats-card { background: var(--surface); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); margin-bottom: 14px; }
.stats-card .form-section { margin-top: 0; padding-top: 0; border-top: 0; font-size: 16px; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stats-table td, .stats-table th { padding: 6px 8px; text-align: left; border-top: 1px solid var(--line); }
.stats-table tr:first-child td, .stats-table th { border-top: 0; }
.stats-table .num { text-align: right; font-weight: 700; white-space: nowrap; }
.stats-table .bar { width: 40%; }
.stats-table .bar span { display: block; height: 8px; border-radius: 4px; background: var(--accent); min-width: 2px; }
