/* ============================================================
   АДМИНКА — карточный стиль (как в профиле)
   ============================================================ */
body.page-admin {
    background-color: #f5f4f2;
}

html:has(body.page-admin) {
    background-color: #f5f4f2;
}

body.page-admin main {
    padding-bottom: 0;
}

body.page-admin footer {
    background: #f5f4f2;
}

body.page-admin main.container {
    max-width: none;
    padding: 0;
}

@media (min-width: 521px) {
    body.page-admin main.container {
        max-width: 500px;
        padding: 0 3px;
    }
}

/* Раздел «Полезное» — то же оформление, что у админки */
body.page-links { background-color: #f5f4f2; }
html:has(body.page-links) { background-color: #f5f4f2; }
body.page-links main { padding-bottom: 0; }
body.page-links footer { background: #f5f4f2; }
body.page-links main.container { max-width: none; padding: 0; }

@media (min-width: 521px) {
    body.page-links main.container { max-width: 500px; padding: 0 3px; }
}

.pnl-wrap {
    display: block;
    position: relative;
    z-index: 1;
    width: 100%;
    background: #f5f4f2;
    margin: 0 0 -80px;
    padding: 8px 0 88px;
    min-height: calc(100vh - 52px);
    overflow: visible;
}

.pnl-inner { padding: 0; }

@media (min-width: 521px) {
    .pnl-inner { padding: 0 10px; }
}

/* --- шапка страницы --- */
.pnl-head {
    padding: 4px 16px 16px;
}

/* Тот же вид, что и .vd-back на публичных страницах: компактная пилюля.
   Правим здесь, а не в 16 файлах админки — разметка не меняется. */
.pnl-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 11px 0 9px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: #ffffff;
    color: #6b6a67;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -.1px;
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .15s ease, color .15s ease, transform .12s ease;
}

.pnl-back i {
    font-size: 10px;
    display: block;
    flex: 0 0 auto;
}

.pnl-back:hover { color: #21201e; }
.pnl-back:active { transform: scale(.96); background: #f2f1ee; }

.pnl-title {
    margin: 0;
    font-size: 26px;
    line-height: 30px;
    font-weight: 700;
    letter-spacing: -.4px;
    color: #21201e;
}

.pnl-subtitle {
    margin-top: 3px;
    font-size: 15px;
    line-height: 19px;
    letter-spacing: -.1px;
    color: #9c9b97;
}

/* --- карточка --- */
.pnl-card {
    background: #ffffff;
    border-radius: 22px;
    margin-bottom: 7px;
    overflow: hidden;
}

.pnl-card--pad { padding: 5px 0; }

.pnl-card__head {
    padding: 16px 18px 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: #9c9b97;
}

.pnl-card__inner { padding: 16px 18px 18px; }

/* --- строка-ссылка --- */
.pnl-row {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 66px;
    padding: 10px 18px 10px 13px;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    font-weight: 400;
    text-align: left;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border-radius: 0;
    transition: background-color .1s ease;
}

.pnl-row:hover { background: transparent; }
.pnl-row:active { background: #f7f6f4; transform: none; }

.pnl-row + .pnl-row::before {
    content: "";
    position: absolute;
    left: 52px;
    right: 18px;
    top: 0;
    height: 1px;
    background: #e6e5e3;
}

.pnl-ico {
    flex: 0 0 auto;
    width: 43px;
    height: 43px;
    margin-right: 9px;
    border-radius: 14px;
    background: #eeeeee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #21201e;
    font-size: 17px;
}

.pnl-ico--red { background: #ffece9; color: #fc5230; }
.pnl-ico--green { background: #e6f6ea; color: #1d7a37; }
.pnl-ico--amber { background: #fdf3dc; color: #b78103; }

.pnl-row__body { flex: 1 1 auto; min-width: 0; }

.pnl-row__title {
    display: block;
    font-size: 17px;
    line-height: 21px;
    letter-spacing: -.2px;
    color: #21201e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pnl-row__sub {
    display: block;
    font-size: 14px;
    line-height: 18px;
    letter-spacing: -.1px;
    color: #9c9b97;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pnl-row__chev { flex: 0 0 auto; margin-left: 8px; display: block; }

.pnl-badge {
    flex: 0 0 auto;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    margin-right: 10px;
    border-radius: 11px;
    background: #fc5230;
    box-shadow: 0 2px 9px rgba(252,82,48,.4), 0 1px 3px rgba(252,82,48,.3);
    color: #fff;
    font-size: 13px;
    line-height: 21px;
    font-weight: 500;
    text-align: center;
}

/* --- плитки статистики --- */
.pnl-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 13px;
}

.pnl-tile {
    position: relative;
    border-radius: 16px;
    background: #f5f4f2;
    padding: 14px 16px 16px;
    overflow: hidden;
    min-width: 0;
}

.pnl-tile__value {
    font-size: 24px;
    line-height: 26px;
    font-weight: 700;
    letter-spacing: -.3px;
    color: #21201e;
}

.pnl-tile__label {
    margin-top: 2px;
    font-size: 14px;
    line-height: 18px;
    letter-spacing: -.1px;
    color: #9c9b97;
}

.pnl-tile__ico {
    position: absolute;
    right: -6px;
    bottom: -8px;
    font-size: 46px;
    color: rgba(33,32,30,.055);
    pointer-events: none;
}

.pnl-tile--alert { background: #ffece9; }
.pnl-tile--alert .pnl-tile__value { color: #fc5230; }
.pnl-tile--alert .pnl-tile__ico { color: rgba(252,82,48,.13); }

/* --- элемент списка (товар, юзер, заявка) --- */
.pnl-item {
    position: relative;
    padding: 14px 18px 14px 13px;
}

.pnl-item + .pnl-item::before {
    content: "";
    position: absolute;
    left: 13px;
    right: 18px;
    top: 0;
    height: 1px;
    background: #e6e5e3;
}

.pnl-item__top {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.pnl-item__thumb {
    flex: 0 0 auto;
    width: 52px;
    height: 68px;
    border-radius: 12px;
    object-fit: cover;
    background: #f5f4f2;
    display: block;
}

.pnl-item__body { flex: 1 1 auto; min-width: 0; }

.pnl-item__title {
    font-size: 17px;
    line-height: 21px;
    letter-spacing: -.2px;
    color: #21201e;
    font-weight: 500;
    margin: 0 0 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pnl-item__meta {
    font-size: 14px;
    line-height: 18px;
    letter-spacing: -.1px;
    color: #9c9b97;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pnl-item__price {
    font-size: 15px;
    font-weight: 700;
    color: #21201e;
    margin-top: 3px;
}

.pnl-item__acts {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* --- кнопки --- */
.pnl-btn {
    height: 38px;
    min-width: 38px;
    padding: 0 14px;
    border-radius: 12px;
    background: #f5f4f2;
    color: #21201e;
    border: 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    cursor: pointer;
    width: auto;
}

.pnl-btn:active { opacity: .7; }
.pnl-btn--dark { background: #21201e; color: #fff; }
.pnl-btn--green { background: #e6f6ea; color: #1d7a37; }
.pnl-btn--red { background: #ffece9; color: #fc5230; }
.pnl-btn--wide { width: 100%; }

.pnl-btn[disabled] {
    background: #efeeec;
    color: #b6b5b1;
    cursor: default;
}

/* --- формы --- */
.pnl-label {
    display: block;
    font-size: 13px;
    color: #9c9b97;
    margin: 0 0 6px;
    letter-spacing: -.1px;
}

.pnl-input,
.pnl-card input[type="text"],
.pnl-card input[type="number"],
.pnl-card input[type="password"],
.pnl-card input[type="datetime-local"],
.pnl-card select,
.pnl-card textarea {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    background: #f5f4f2;
    border: 0;
    border-radius: 13px;
    font-size: 16px;
    font-family: inherit;
    color: #21201e;
    outline: none;
}

.pnl-card textarea { min-height: 90px; resize: vertical; }
.pnl-card input::placeholder { color: #b6b5b1; }

.pnl-field { margin-bottom: 14px; }
.pnl-field:last-child { margin-bottom: 0; }

.pnl-row-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pnl-row-inline .pnl-btn { flex: 0 0 auto; height: 46px; }

.pnl-hint {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 17px;
    color: #9c9b97;
}

.pnl-hint--warn { color: #fc5230; }

/* --- уведомления --- */
.pnl-alert {
    border-radius: 18px;
    padding: 14px 18px;
    margin-bottom: 7px;
    font-size: 15px;
    line-height: 20px;
    letter-spacing: -.1px;
}

.pnl-alert--ok { background: #e6f6ea; color: #1d7a37; }
.pnl-alert--err { background: #ffeceb; color: #c62828; }

.pnl-empty {
    padding: 26px 18px;
    text-align: center;
    color: #9c9b97;
    font-size: 15px;
}

/* --- статусы --- */
.pnl-status { font-size: 14px; font-weight: 600; }
.pnl-status--ok { color: #1d7a37; }
.pnl-status--wait { color: #b78103; }
.pnl-status--bad { color: #fc5230; }
.pnl-status--muted { color: #9c9b97; }

/* --- сетка чекбоксов (золотые билеты) --- */
.pnl-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
    padding: 2px;
    margin-bottom: 14px;
}

.pnl-check {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 9px 4px;
    border-radius: 11px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    background: #f5f4f2;
    color: #21201e;
    user-select: none;
}

.pnl-check input { width: auto; margin: 0; }
.pnl-check--on { background: #f5cf62; }

/* --- таблицы внутри карточек --- */
.pnl-card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pnl-card th {
    text-align: left;
    padding: 10px 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #9c9b97;
    font-weight: 700;
    border-bottom: 1px solid #e6e5e3;
}

.pnl-card td {
    padding: 12px 8px;
    border-bottom: 1px solid #f0efed;
    vertical-align: middle;
}

.pnl-card tr:last-child td { border-bottom: 0; }

.pnl-scroll {
    overflow-x: auto;
    padding: 0 13px 6px;
    -webkit-overflow-scrolling: touch;
}

/* --- раскрывающаяся форма внутри карточки --- */
.pnl-form {
    display: none;
    padding: 4px 18px 18px;
    border-top: 1px solid #e6e5e3;
    margin-top: -1px;
}

.pnl-form.open { display: block; }

/* --- бусты участника в списке ивента --- */
.pnl-bst {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.pnl-bst__i {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 16px;
    font-variant-numeric: tabular-nums;
}

.pnl-bst__i i { font-size: 10px; }

/* ============================================================
   ПАГИНАЦИЯ СПИСКОВ АДМИНКИ
   Списки пользователей и товаров больше не грузятся целиком.
   ============================================================ */
.pnl-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 14px 2px 4px;
}

.pnl-pager__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 11px;
    background: #fff;
    color: #21201e;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
    border: 1px solid rgba(0, 0, 0, .07);
}

.pnl-pager__btn:active { opacity: .7; }

.pnl-pager__btn--cur {
    background: #21201e;
    color: #fff;
    border-color: #21201e;
}

.pnl-pager__btn--off {
    opacity: .32;
    pointer-events: none;
}

.pnl-pager__gap {
    color: #b0afab;
    padding: 0 2px;
    font-weight: 700;
}

.pnl-pager__info {
    margin-left: auto;
    font-size: 12px;
    color: #8e8e93;
    font-variant-numeric: tabular-nums;
}
