/* Сброс отступов и box-sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Чтобы body занимал всю высоту окна браузера */
html, body {
    min-height: 100%;
}

/* Основные стили страницы */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;

    /* Фон */
    background-image: url('/static/images/Фон2.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    /* Флекс-контейнер для прижатия футера */
    display: flex;
    flex-direction: column;
    padding: 20px;
}

body.modal-open {
    overflow: hidden;
}

/* Шапка */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: red;
    color: white;
    padding: 10px 20px;
    margin-bottom: 20px;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

header nav a {
    color: white;
    text-decoration: none;
    margin-right: 15px;
    font-weight: bold;
}

header nav a:hover {
    text-decoration: underline;
}

/* Основной контент — занимает всю ширину внутри body */
main {
    flex: 1 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Контейнер для двух блоков */
.blocks-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

/* Карточки с полупрозрачным фоном */
.card {
    flex: 1;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.card h1 {
    color: #24160a;
    line-height: 1.2;
    margin-bottom: 10px;
}

.card p {
    color: #2e241a;
}

.card:first-child {
    justify-content: flex-start;
}

.card:last-child {
    justify-content: center;
    align-items: center;
}

.categories.vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.category-link {
    display: block;
    padding: 10px 20px;
    background-color: #198754;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
    text-align: center;
}

.category-link:hover {
    background-color: #145c37;
}

.category-link-secondary {
    background-color: rgba(255, 255, 255, 0.72);
    color: #2f2418;
}

.category-link-secondary:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

.admin-intro {
    margin-top: 10px;
    margin-bottom: 18px;
}

.admin-error {
    margin: 0;
    color: #991b1b;
    font-weight: 700;
}

.contact-details {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-details h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

.contact-details p {
    margin: 0;
    line-height: 1.45;
}

.contact-map-link {
    margin-top: 8px;
    align-self: flex-start;
}

.intro-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 640px;
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(25, 18, 12, 0.34);
}

.intro-text h1,
.intro-text p,
.about-card h1,
.about-card h2,
.about-card p,
.about-card strong {
    color: #ffffff;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.92);
}

.intro-text p {
    font-size: 19px;
    line-height: 1.6;
}

.about-card {
    max-width: 880px;
}

.about-card .contact-details {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(25, 18, 12, 0.32);
}

.about-lead {
    font-size: 20px;
    line-height: 1.65;
}

.about-card p {
    font-size: 18px;
    line-height: 1.7;
}

.promotion-banner {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(25, 18, 12, 0.32);
    border: 3px solid rgba(180, 35, 24, 0.9);
    box-shadow: 0 10px 24px rgba(180, 35, 24, 0.18);
}

.promotion-banner-label {
    display: inline-flex;
    margin: 0 0 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #b42318;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: none;
}

.promotion-banner h2,
.promotion-banner p {
    color: #ffffff;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.92);
}

.promotion-banner h2 {
    margin-bottom: 8px;
    font-size: 26px;
    line-height: 1.2;
}

.promotion-banner p {
    font-size: 16px;
    line-height: 1.5;
}

.admin-refresh-form {
    margin-bottom: 16px;
}

.admin-refresh-report {
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.55);
}

.admin-refresh-report h2 {
    margin-bottom: 10px;
    font-size: 18px;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.admin-stats-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
}

.admin-stats-form h2 {
    font-size: 18px;
}

.admin-stats-form input {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
}

.admin-stats-form textarea {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    min-height: 110px;
}

.admin-stats-form select {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

.admin-list,
.admin-user-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-list-item,
.admin-user-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.48);
}

.admin-list-item {
    align-items: flex-start;
    flex-direction: column;
}

.admin-list-item strong {
    color: #101828;
}

.admin-list-item span {
    color: #475467;
    font-size: 14px;
}

.admin-users-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.admin-users-summary span {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(180, 35, 24, 0.08);
    color: #8f1d14;
    font-size: 13px;
    font-weight: 700;
}

.admin-active-badge-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.admin-active-badge {
    display: inline-flex;
    align-self: flex-start;
    padding: 5px 10px;
    border-radius: 999px;
    background: #b42318;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-user-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-user-text strong {
    color: #101828;
}

.admin-user-text span {
    color: #475467;
    font-size: 13px;
}

.admin-user-role-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
}

.admin-user-role-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #475467;
}

.admin-users-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 18px;
}

.admin-users-sidebar,
.admin-users-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-user-select {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.48);
    color: inherit;
    text-decoration: none;
}

.admin-user-select.active {
    border: 2px solid rgba(180, 35, 24, 0.75);
    background: rgba(255, 255, 255, 0.7);
}

.admin-user-select span {
    color: #475467;
    font-size: 13px;
}

.admin-permissions-list {
    display: grid;
    gap: 8px;
}

.admin-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.promotion-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.promotion-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
}

.promotion-list-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.promotion-list-text span {
    font-size: 13px;
    color: #475569;
}

.promotion-list-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.promotion-list-actions form {
    margin: 0;
}

.stats-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-hero {
    padding: 24px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stats-kicker {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #b42318;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.stats-filter-form {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
}

.stats-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
    font-weight: 600;
}

.stats-filter-field select,
.stats-filter-field input {
    padding: 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
}

.stats-summary-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
}

.stats-summary-label {
    font-size: 13px;
    color: #667085;
}

.stats-summary-value {
    font-size: 18px;
    color: #101828;
}

.stats-table-wrap {
    overflow-x: auto;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th,
.stats-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #eaecf0;
    white-space: nowrap;
}

.stats-table th {
    background: rgba(248, 250, 252, 0.96);
    color: #344054;
    font-size: 14px;
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    flex-shrink: 0;
}

.catalog-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.catalog-hero {
    padding: 24px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.catalog-filter {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
    padding: 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
    font-weight: 600;
}

.filter-field select {
    padding: 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
}

.filter-button,
.filter-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
}

.filter-button {
    border: none;
    background: #198754;
    color: #fff;
    cursor: pointer;
}

.filter-reset {
    background: #eef2f6;
    color: #344054;
}

.catalog-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #b42318;
    margin-bottom: 8px;
}

.catalog-back-link {
    display: inline-flex;
    margin-top: 14px;
    padding: 9px 14px;
    border-radius: 10px;
    background: rgba(180, 35, 24, 0.1);
    color: #8f1d14;
    text-decoration: none;
    font-weight: 700;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.80);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
    min-height: 100%;
}

.product-media {
    position: relative;
    min-height: 190px;
    background: linear-gradient(135deg, #f7f4ee, #e8dfd1);
}

.product-image-placeholder {
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    color: rgba(78, 48, 23, 0.75);
}

.product-image {
    width: 100%;
    height: 190px;
    display: block;
    object-fit: contain;
    background: #f8fafc;
    padding: 10px;
}

.product-image-button {
    width: 100%;
    border: none;
    padding: 0;
    background: transparent;
    cursor: zoom-in;
}

.product-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.product-badge.in-stock {
    background: #d1fadf;
    color: #166534;
}

.product-badge.out-of-stock {
    background: #fee2e2;
    color: #991b1b;
}

.product-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px 10px;
    min-height: 82px;
    background: rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(3px);
}

.product-code {
    font-size: 11px;
    color: #4b5563;
}

.product-title {
    font-size: 14px;
    line-height: 1.15;
    color: #1f2937;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    color: #374151;
}

.product-own-badge {
    align-self: flex-start;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(25, 135, 84, 0.16);
    color: #0b5d39;
    font-size: 11px;
    font-weight: 700;
}

.product-price {
    margin-top: auto;
    font-size: 16px;
    font-weight: 800;
    color: #b42318;
}

.reaction-bar {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.reaction-form {
    flex: 1;
}

.reaction-button {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #b8c1cc;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.98);
    color: #1f2937;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.reaction-button.active.like {
    background: rgba(220, 252, 231, 0.95);
    border-color: #86efac;
    color: #166534;
    box-shadow: 0 3px 8px rgba(22, 163, 74, 0.12);
}

.reaction-button.active.dislike {
    background: rgba(254, 226, 226, 0.95);
    border-color: #fca5a5;
    color: #991b1b;
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.12);
}

.catalog-empty {
    padding: 32px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.85);
    text-align: center;
}

/* ===== МОДАЛЬНОЕ ОКНО ДЛЯ ФОТО (ОСНОВНЫЕ СТИЛИ) ===== */
.image-modal[hidden] {
    display: none;
}

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.image-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
}

.image-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(900px, 100%);
    max-height: 90vh;
    padding: 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.image-modal-close {
    align-self: flex-end;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    background: #eef2f6;
    color: #344054;
    font-weight: 700;
    cursor: pointer;
}

.image-modal-title {
    font-size: 18px;
    color: #101828;
}

.image-modal-meta {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f5f7fa;
}

.image-modal-meta[hidden] {
    display: none;
}

.image-modal-meta-item {
    margin: 0;
    font-size: 14px;
    color: #344054;
}

.image-modal-meta-item span {
    font-weight: 600;
}

.image-modal-meta-item strong {
    color: #101828;
}

.image-modal-content {
    width: 100%;
    max-height: calc(90vh - 120px);
    object-fit: contain;
    background: #f8fafc;
    border-radius: 12px;
}

.image-modal-counter {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
    pointer-events: none;
    z-index: 1002;
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ - ФОТО НА ВЕСЬ ЭКРАН ===== */
@media (max-width: 768px) {
    .image-modal {
        padding: 0 !important;
    }

    .image-modal-dialog {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        background: rgba(0, 0, 0, 0.95) !important;
        gap: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .image-modal-content {
        width: 100% !important;
        flex: 1 !important;
        max-height: none !important;
        object-fit: contain !important;
        background: transparent !important;
        border-radius: 0 !important;
    }

    .image-modal-title {
        position: fixed !important;
        top: 12px !important;
        left: 12px !important;
        z-index: 10002 !important;
        background: rgba(0, 0, 0, 0.7) !important;
        color: white !important;
        padding: 6px 12px !important;
        border-radius: 20px !important;
        font-size: 14px !important;
        max-width: 55% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: block !important;
        margin: 0 !important;
    }

    .image-modal-buttons {
        position: fixed !important;
        top: 12px !important;
        right: 12px !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        z-index: 10002 !important;
    }

    .image-modal-goto,
    .image-modal-close {
        font-size: 12px !important;
        padding: 6px 12px !important;
        border-radius: 20px !important;
        background: rgba(0, 0, 0, 0.7) !important;
        backdrop-filter: blur(4px) !important;
        border: none !important;
        cursor: pointer !important;
        white-space: nowrap !important;
    }

    .image-modal-goto {
        background: #198754 !important;
        color: white !important;
    }

    .image-modal-close {
        background: rgba(255, 255, 255, 0.2) !important;
        color: white !important;
    }

    .image-modal-counter {
        position: fixed !important;
        bottom: 12px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 10002 !important;
        background: rgba(0, 0, 0, 0.7) !important;
        color: white !important;
        padding: 4px 12px !important;
        border-radius: 20px !important;
        font-size: 13px !important;
        display: block !important;
        pointer-events: none !important;
    }

    .image-modal-meta {
        position: fixed !important;
        bottom: 50px !important;
        left: 12px !important;
        right: 12px !important;
        z-index: 10001 !important;
        background: rgba(0, 0, 0, 0.7) !important;
        backdrop-filter: blur(8px) !important;
        border-radius: 12px !important;
        padding: 8px 12px !important;
        margin: 0 !important;
    }
}

@media (max-width: 480px) {
    .image-modal-goto,
    .image-modal-close {
        font-size: 11px !important;
        padding: 5px 10px !important;
    }
    .image-modal-buttons {
        gap: 6px !important;
        right: 8px !important;
    }
    .image-modal-title {
        font-size: 12px !important;
        padding: 5px 10px !important;
        top: 10px !important;
        left: 10px !important;
    }
    .image-modal-counter {
        font-size: 12px !important;
        padding: 3px 10px !important;
        bottom: 10px !important;
    }
    .image-modal-meta {
        bottom: 45px !important;
        left: 8px !important;
        right: 8px !important;
    }
}

.image-modal-meta {
    background: rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(8px) !important;
    border-radius: 12px !important;
    padding: 10px 14px !important;
    color: #ffffff !important;
}

.image-modal-meta-item {
    margin: 4px 0;
    font-size: 14px;
    color: #ffffff !important;
    text-shadow: 0 0 2px rgba(0,0,0,0.5) !important;
}

.image-modal-meta-item span {
    font-weight: 600;
    color: #dddddd !important;
}

.image-modal-meta-item strong {
    color: #ffcc88 !important;
    font-weight: 700 !important;
}

@media (max-width: 768px) {
    .image-modal-meta {
        background: rgba(0, 0, 0, 0.95) !important;
        bottom: 50px !important;
        left: 12px !important;
        right: 12px !important;
    }
    .image-modal-meta-item {
        font-size: 12px !important;
    }
    .image-modal-meta-item strong {
        font-size: 13px !important;
    }
}

/* ===== НОВЫЕ АДАПТИВНЫЕ ПРАВИЛА ДЛЯ СТРАНИЦЫ УПРАВЛЕНИЯ ПОЛЬЗОВАТЕЛЯМИ ===== */
@media (max-width: 768px) {
    /* Переводим две колонки в одну вертикальную */
    .admin-users-layout {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    /* Список пользователей и форма идут друг за другом */
    .admin-users-sidebar,
    .admin-users-main {
        width: 100%;
        min-width: 0;
    }

    /* Уменьшаем отступы в карточках и формах */
    .admin-stats-form {
        padding: 12px;
    }

    /* Чекбоксы и тексты переносим нормально */
    .admin-checkbox {
        display: flex;
        align-items: center;
        gap: 8px;
        word-break: break-word;
        font-size: 14px;
    }

    /* Сетка прав пользователя — одна колонка */
    .admin-permissions-list {
        grid-template-columns: 1fr !important;
        gap: 0.5rem;
    }

    /* Поля ввода и кнопки на всю ширину */
    .admin-stats-form input,
    .admin-stats-form select,
    .admin-stats-form button,
    .admin-stats-form textarea {
        width: 100%;
        box-sizing: border-box;
    }

    /* Чтобы длинные названия ролей не вылезали */
    select {
        max-width: 100%;
        white-space: normal;
        word-break: break-word;
    }

    /* Если внутри формы появляются очень длинные строки — разрешаем скролл */
    .admin-users-main .admin-stats-form {
        overflow-x: auto;
    }

    /* Карточка выбранного пользователя: уменьшаем шрифт и отступы */
    .admin-stats-form p,
    .admin-stats-form strong {
        font-size: 14px;
        word-break: break-word;
    }

    /* Заголовки поменьше */
    .admin-stats-form h2 {
        font-size: 1.2rem;
    }

    /* Ссылка "Назад в админку" на телефоне видна нормально */
    .catalog-back-link {
        display: inline-block;
        margin-top: 10px;
    }
}

/* Для очень маленьких экранов (≤480px) – ещё плотнее */
@media (max-width: 480px) {
    .admin-stats-form {
        padding: 10px;
    }

    .admin-stats-form h2 {
        font-size: 1.1rem;
    }

    .admin-checkbox {
        font-size: 13px;
        gap: 6px;
    }

    .admin-list-item,
    .admin-user-select {
        padding: 8px;
    }
}