/* Кабинет продавца. Те же токены и компоненты, что у витрины (store.css). */
body.admin { background: var(--soft); }

/* вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px var(--pad); }
.login__card {
  width: 100%; max-width: 400px; padding: 34px 24px 28px; border-radius: 26px; background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .06); animation: view-in .4s var(--ease) both;
}
.login__card img { height: 22px; width: auto; }
.login__card h1 { margin-top: 26px; font-size: 26px; font-weight: 300; }
.login__card p { margin-top: 6px; color: var(--muted); }
.login__card form { margin-top: 22px; display: grid; gap: 14px; }

/* шапка */
.ad-top { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.ad-top__in { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ad-logo { display: flex; align-items: center; gap: 12px; }
.ad-logo img { height: 18px; width: auto; }
.ad-logo span { padding-left: 12px; border-left: 1px solid var(--line); font-size: 14px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.ad-top__actions { display: flex; align-items: center; gap: 4px; }
.ad-top__actions a, .ad-top__actions button { height: 40px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; font-size: 15px; color: var(--ink-2); }
.ad-top__actions a:hover, .ad-top__actions button:hover { background: var(--soft); }
.ad-tabs { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.ad-tabs::-webkit-scrollbar { display: none; }
.ad-tabs button {
  position: relative; flex: none; height: 48px; padding: 0 14px; font-size: 16px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px; transition: color .2s;
}
.ad-tabs button::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--ink); transform: scaleX(0); transition: transform .25s var(--ease); }
.ad-tabs button[aria-selected="true"] { color: var(--ink); }
.ad-tabs button[aria-selected="true"]::after { transform: scaleX(1); }
.ad-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; }

.ad-main { padding-top: 22px; padding-bottom: 64px; }
.ad-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.ad-head h1 { font-size: 26px; font-weight: 300; }
.ad-head h1 span { color: var(--muted); font-size: 20px; }
.btn--sm { min-height: 44px; padding: 0 18px; font-size: 14px; }

.panel { background: #fff; border-radius: 20px; padding: 20px; }
.panel + .panel { margin-top: 14px; }
.panel h2 { font-size: 18px; font-weight: 500; }
.panel > p { margin-top: 6px; color: var(--muted); font-size: 15px; line-height: 1.5; }

/* заказы */
.ad-main .seg { margin-top: 0; margin-bottom: 14px; }
.ad-main .seg button { background: #fff; }
.ad-main .seg button[aria-pressed="true"] { background: var(--ink); }
.ad-main .seg small { margin-left: 4px; opacity: .6; }
.orders { display: grid; gap: 10px; }
.order { background: #fff; border-radius: 18px; overflow: hidden; animation: view-in .35s var(--ease) both; }
.order.is-new-arrival { box-shadow: 0 0 0 2px var(--gold); }
.order__sum { width: 100%; text-align: left; padding: 16px 18px; display: grid; gap: 6px; }
.order__r1 { display: flex; align-items: baseline; gap: 10px; }
.order__r1 b { font-size: 18px; font-weight: 600; }
.order__r1 .muted { font-size: 14px; }
.order__r1 .order__total { margin-left: auto; font-size: 18px; font-weight: 600; white-space: nowrap; }
.order__r2 { font-size: 16px; }
.order__r3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 14px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; font-size: 13.5px; background: var(--soft); color: var(--ink-2); white-space: nowrap; }
.pill--new { background: var(--ink); color: #fff; }
.pill--processing { background: #fff; box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); }
.pill--shipped { background: #e9e4da; }
.pill--done { background: var(--soft); color: var(--muted); }
.pill--cancelled { background: var(--soft); color: var(--muted); text-decoration: line-through; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.pill.is-paid i { background: var(--ok); }
.order__body { padding: 0 18px 18px; border-top: 1px solid var(--line); animation: fade .25s ease both; }
.order__items { list-style: none; margin: 0; padding: 12px 0 4px; }
.order__items li { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; }
.order__items img { width: 52px; height: 52px; border-radius: 10px; border: 1px solid var(--line); object-fit: contain; background: #fff; }
.order__items span { font-size: 15px; line-height: 1.35; }
.order__items small { display: block; color: var(--muted); font-size: 14px; }
.order__items b { font-weight: 600; white-space: nowrap; }
.order__info { display: grid; gap: 10px; margin-top: 10px; padding: 14px; border-radius: 14px; background: var(--soft); font-size: 15px; }
.order__info dt { font-size: 13px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.order__info dd { margin: 2px 0 0; }
.order__contact { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.order__contact .btn { min-height: 46px; font-size: 14px; }
.order__status h3 { margin: 18px 0 10px; font-size: 13px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; font-weight: 400; }
.status-set { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.status-set button { height: 46px; border-radius: 12px; border: 1px solid var(--line); font-size: 15px; transition: background .2s, color .2s; }
.status-set button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.empty-box { padding: 40px 20px; border-radius: 20px; background: #fff; text-align: center; color: var(--muted); }
.empty-box b { display: block; color: var(--ink); font-size: 18px; font-weight: 500; margin-bottom: 6px; }

/* товары */
.ad-main .search { background: #fff; margin-bottom: 14px; }
.plist { display: grid; gap: 8px; }
.prow {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  padding: 10px 14px 10px 10px; border-radius: 16px; background: #fff; cursor: pointer;
  transition: box-shadow .2s;
}
.prow:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, .05); }
.prow img { width: 64px; height: 64px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.prow__brand { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.prow__name { font-size: 16px; line-height: 1.3; }
.prow__price { font-size: 14px; color: var(--muted); margin-top: 2px; }
.prow.is-off { opacity: .55; }

.switch { position: relative; display: inline-block; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #d9d5cf; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .25s var(--ease); }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* редактор товара */
.drawer { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; background: rgba(13, 13, 13, .35); animation: fade .2s ease both; }
.drawer__panel { width: 100%; max-width: 560px; height: 100%; display: flex; flex-direction: column; background: #fff; animation: drawer-in .32s var(--ease) both; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
.drawer__head { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-bottom: 1px solid var(--line); min-height: 62px; }
.drawer__head h2 { flex: 1; font-size: 18px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer__body { flex: 1; overflow-y: auto; padding: 18px var(--pad) calc(28px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.drawer__body h3 { margin: 26px 0 12px; font-size: 13px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; font-weight: 400; }
.photo { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; }
.photo img { width: 120px; height: 120px; border-radius: 16px; border: 1px solid var(--line); object-fit: contain; background: #fff; }
.photo .btn { min-height: 46px; font-size: 14px; }
.photo small { display: block; margin-top: 8px; color: var(--muted); font-size: 13.5px; }
.seg-in { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; border-radius: 14px; background: var(--soft); }
.seg-in label { position: relative; }
.seg-in input { position: absolute; opacity: 0; }
.seg-in span { display: grid; place-items: center; height: 42px; border-radius: 10px; font-size: 15px; cursor: pointer; transition: background .2s, box-shadow .2s; }
.seg-in input:checked + span { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .1); font-weight: 500; }
.seg-in input:focus-visible + span { outline: 2px solid var(--ink); }
.vrows { display: grid; gap: 8px; }
.vrow { display: grid; grid-template-columns: 1fr 1.4fr 44px; gap: 8px; align-items: center; }
.unit { position: relative; }
.unit input { width: 100%; height: 50px; padding: 0 40px 0 14px; border-radius: 12px; border: 1px solid var(--line); font-size: 16px; outline: none; }
.unit input:focus { border-color: var(--ink); }
.unit::after { content: attr(data-unit); position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; pointer-events: none; }
.vrow button { width: 44px; height: 44px; border-radius: 50%; font-size: 22px; color: var(--muted); }
.vrow button:hover { background: var(--soft); color: var(--danger); }
.link-btn { margin-top: 10px; height: 42px; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding: 14px 16px; border-radius: 14px; background: var(--soft); font-size: 16px; }
.danger-link { margin-top: 18px; height: 44px; color: var(--danger); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.drawer .fields { margin-top: 16px; }

/* импорт */
.import-grid { display: grid; gap: 14px; }
.import-grid .panel + .panel { margin-top: 0; }
.drop {
  margin-top: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 130px; padding: 18px; border-radius: 16px; border: 1.5px dashed #cfcac3; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop:hover, .drop.is-over { border-color: var(--ink); background: var(--soft); }
.drop b { font-size: 16px; font-weight: 500; }
.drop span { color: var(--muted); font-size: 14px; }
.gsheet { display: grid; gap: 10px; margin-top: 14px; }
.gsheet input { width: 100%; height: 52px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); font-size: 16px; outline: none; }
.gsheet input:focus { border-color: var(--ink); }
.format { margin-top: 12px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.format code { padding: 1px 7px; border-radius: 6px; background: var(--soft); font-family: inherit; font-size: 14px; white-space: nowrap; }
.panel .btn--ghost { margin-top: 14px; min-height: 46px; font-size: 14px; }
.notice { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #fbeceb; color: var(--danger); font-size: 15px; }
.notice--ok { background: #e9f1ec; color: var(--ok); }
.preview { margin-top: 14px; animation: view-in .35s var(--ease) both; }
.preview__stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.table-wrap { margin: 14px -20px 0; overflow-x: auto; }
.table-wrap table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14.5px; }
.table-wrap th, .table-wrap td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap th { font-weight: 400; color: var(--muted); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.table-wrap th:first-child, .table-wrap td:first-child { padding-left: 20px; }
.table-wrap td small { display: block; color: var(--muted); }
.table-wrap tr.is-error td { color: var(--danger); }
.prices { display: flex; flex-wrap: wrap; gap: 4px; }
.prices span { padding: 2px 7px; border-radius: 6px; background: var(--soft); white-space: nowrap; font-size: 13.5px; }
.preview .options { margin-top: 16px; }
.preview .btn--dark { margin-top: 16px; }

/* настройки */
.settings-grid { display: grid; gap: 14px; }
.settings-grid .panel + .panel { margin-top: 0; }
.unit-field input { padding-right: 40px; }

@media (min-width: 760px) {
  .import-grid, .settings-grid { grid-template-columns: 1fr 1fr; }
  .status-set { grid-template-columns: repeat(5, 1fr); }
  .order__contact { display: flex; }
  .order__contact .btn { padding: 0 22px; }
}
@media (min-width: 960px) {
  .ad-top__in { height: 66px; }
  .ad-logo img { height: 22px; }
  .order__open { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
}

.ad-top__actions a, .ad-top__actions button { white-space: nowrap; }
@media (max-width: 520px) {
  .ad-logo span { display: none; }
}

/* загрузка и ошибка: кабинет никогда не остаётся пустым */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px var(--pad); text-align: center; }
.boot img { height: 22px; width: auto; }
.boot p { max-width: 340px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.boot p b { display: block; margin-bottom: 4px; color: var(--ink); font-size: 20px; font-weight: 400; }
.boot__spin { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
