:root {
    --bg: #fbf8f2;
    --surface: #fffefa;
    --text: #26352d;
    --muted: #727a70;
    --line: #e9e2d6;
    --accent: #315544;
    --accent-2: #527560;
    --accent-grad: linear-gradient(135deg, #315544 0%, #527560 100%);
    --accent-soft: rgba(49, 85, 68, .1);
    --green: #4e7852;
    --red: #e11d48;
    --radius: 20px;
    --shadow-sm: 0 2px 8px rgba(56, 48, 35, .05), 0 8px 24px rgba(56, 48, 35, .06);
    --shadow-lg: 0 18px 44px rgba(56, 48, 35, .15);
    --ring: 0 0 0 4px var(--accent-soft);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
#blog-empty[hidden], #blog-list[hidden], #blog-post[hidden], #blog-heading[hidden], #blog-count[hidden] { display: none !important; }
#blog-empty[hidden] { display: none; }
#blog-list[hidden] { display: none; }
#blog-post[hidden] { display: none; }
#blog-heading[hidden] { display: none; }
#blog-count[hidden] { display: none; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background:
        radial-gradient(1200px 500px at 80% -10%, rgba(124, 58, 237, .08), transparent 60%),
        radial-gradient(900px 400px at -10% 10%, rgba(79, 70, 229, .07), transparent 55%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    line-height: 1.45;
}

/* ---------- Header ---------- */
header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

.topbar { background: var(--accent-grad); color: #fff; }

.topbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: .42rem clamp(1rem, 4vw, 2.75rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .35rem 1.25rem;
    flex-wrap: wrap;
}

.topbar-item {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .01em;
}

.topbar-item svg { width: 15px; height: 15px; }
.topbar-item--dim { opacity: .82; font-weight: 600; }
.topbar-stores { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; }
.topbar-store {
    padding: .12rem .6rem;
    border-radius: 999px;
    background: #005bff;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transition: filter .2s ease;
}
.topbar-store + .topbar-store { background: #cb11ab; }
.topbar-store:hover { filter: brightness(1.12); }

.header-main {
    max-width: 1240px;
    margin: 0 auto;
    padding: .85rem clamp(1rem, 4vw, 2.75rem);
    display: flex;
    align-items: center;
    gap: clamp(.75rem, 2vw, 2rem);
}

.brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
    min-width: 0;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: .6rem;
}

header h1::before {
    content: '';
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--accent-grad);
    box-shadow: 0 4px 12px rgba(79, 70, 229, .35);
    flex-shrink: 0;
}

header h1.has-logo::before { display: none; }

.site-logo {
    height: 64px;
    width: auto;
    max-width: min(52vw, 320px);
    object-fit: contain;
    border-radius: 10px;
    display: block;
}

.brand-tag {
    font-size: .72rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: .05em;
    text-transform: lowercase;
    margin: .18rem 0 0 .05rem;
}

.header-search {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 620px;
    margin: 0 auto;
}

.header-search .search-input { width: 100%; }

/* ---------- Search suggestions ---------- */
.search-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: .35rem;
    max-height: min(62vh, 430px);
    overflow-y: auto;
}

.search-suggest[hidden] { display: none; }

.suggest-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: .5rem .6rem;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    color: var(--text);
    transition: background .15s ease;
}

.suggest-item:hover, .suggest-item.active { background: var(--accent-soft); }

.suggest-item img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    background: #eef1f7;
    flex-shrink: 0;
}

.suggest-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.suggest-name {
    font-weight: 700;
    font-size: .9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggest-cat { font-size: .74rem; color: var(--muted); font-weight: 600; }

.suggest-price { color: var(--green); font-weight: 800; font-size: .9rem; white-space: nowrap; }

.suggest-empty { padding: .7rem .8rem; color: var(--muted); font-weight: 600; font-size: .9rem; }

.header-actions { display: flex; gap: .6rem; align-items: center; flex-shrink: 0; }

.cart-btn, .admin-btn {
    border: none;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    font-size: .98rem;
    padding: .7rem 1.3rem;
    border-radius: 999px;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    white-space: nowrap;
}

.cart-ico { width: 20px; height: 20px; flex-shrink: 0; }

.cart-btn {
    background: var(--surface);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
}

.cart-btn:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px var(--accent), var(--shadow-sm);
    color: var(--accent);
}

#cart-count {
    background: var(--accent-grad);
    color: #fff;
    min-width: 22px;
    height: 22px;
    padding: 0 .45rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
}

.fav-btn-header {
    border: none;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    font-size: .98rem;
    padding: .7rem 1.15rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    white-space: nowrap;
    background: var(--surface);
    color: #e11d48;
    box-shadow: inset 0 0 0 1.5px rgba(225, 29, 72, .4), var(--shadow-sm);
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}

.fav-btn-header:hover {
    transform: translateY(-1px);
    background: #fff1f2;
    box-shadow: inset 0 0 0 1.5px #e11d48, 0 8px 18px rgba(225, 29, 72, .18);
}

.fav-ico {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
}

.fav-btn-header.active {
    background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(225, 29, 72, .35);
}

.fav-btn-header.active .fav-ico { fill: currentColor; }

#fav-count {
    background: #e11d48;
    color: #fff;
    min-width: 22px;
    height: 22px;
    padding: 0 .45rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
}

.fav-btn-header.active #fav-count { background: rgba(255, 255, 255, .3); }

.admin-btn {
    background: #1e293b;
    color: #fff;
    box-shadow: 0 6px 16px rgba(30, 41, 59, .25);
}

.admin-btn:hover { background: #0f172a; transform: translateY(-1px); }

/* ---------- Catalog ---------- */
main { flex: 1; padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 4vw, 2.5rem); }

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.4rem;
    max-width: 1240px;
    margin: 0 auto;
}

.product {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}

.product:focus-visible { outline: none; box-shadow: var(--ring), var(--shadow-lg); }

.product:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.product-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform .35s ease;
}

.product:hover .product-image img { transform: scale(1.04); }

.product-info {
    padding: .7rem .8rem .8rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    flex: 1;
}

.product h3 {
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product .category {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent);
    background: var(--accent-soft);
    align-self: flex-start;
    padding: .18rem .5rem;
    border-radius: 999px;
}

.product .price {
    font-size: 1.1rem;
    font-weight: 800;
    color: #cb11ab;
    letter-spacing: -.02em;
    margin-top: .3rem;
}

/* Обычная цена без акции — крупнее */
.product .price.price-regular { font-size: 1.35rem; }

.price-current { font-weight: 800; color: #cb11ab; }
/* Без акции — нейтральный цвет, как у старой цены */
.price-current.price-current-regular { color: #475569; }
.price-old {
    margin-left: .45rem;
    font-size: .92em;
    font-weight: 700;
    color: #475569;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    white-space: nowrap;
}

.product .article {
    font-size: .7rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: .01em;
}

.product-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

/* ---------- Hide prices (admin switch) ---------- */
body.hide-prices .product .price,
body.hide-prices .suggest-price,
body.hide-prices .pv-price,
body.hide-prices .badge-sale,
body.hide-prices .cart-item-price,
body.hide-prices .cart-total,
body.hide-prices .co-item-price,
body.hide-prices .co-total { display: none !important; }

.product button {
    margin: auto 1.15rem 1.15rem;
    background: var(--accent-grad);
    color: #fff;
    border: none;
    padding: .72rem;
    border-radius: 12px;
    font: inherit;
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(79, 70, 229, .3);
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}

.product button:hover { transform: translateY(-2px); filter: brightness(1.07); box-shadow: 0 12px 24px rgba(79, 70, 229, .38); }
.product button:active { transform: translateY(0); }

.product .stock,
.pv-stock .stock {
    margin: .35rem 1.15rem 0;
    font-size: .76rem;
    font-weight: 700;
    color: #16a34a;
}

.product .stock-out,
.pv-stock .stock-out {
    color: #dc2626;
}

.pv-stock { margin-top: .3rem; }

.product button:disabled,
#pv-add:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
}

.product button:disabled:hover,
#pv-add:disabled:hover { transform: none; box-shadow: none; filter: none; }

.stock-inline { margin-left: .5rem; }

.product .badge-new {
    position: absolute;
    top: .7rem;
    left: .7rem;
    z-index: 1;
    background: var(--accent-grad);
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .3rem .68rem;
    border-radius: 999px;
    box-shadow: 0 6px 14px rgba(79, 70, 229, .38);
}

/* Контейнер меток: «Новинка» и «Хит» не наезжают друг на друга */
.product .product-badges {
    position: absolute;
    top: .7rem;
    left: .7rem;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .3rem;
    pointer-events: none;
}

.product .product-badges .badge-new,
.product .product-badges .badge-hit,
.product .product-badges .badge-sale {
    position: static;
    top: auto;
    left: auto;
    margin: 0;
    padding: .3rem .68rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 800;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #fff;
    box-shadow: 0 6px 14px rgba(56, 48, 35, .28);
}

.product .product-badges .badge-new { background: var(--accent-grad); }
.product .product-badges .badge-hit {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}
.product .product-badges .badge-sale {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

/* ---------- In-cart button state ---------- */
.product button.in-cart-btn {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 8px 18px rgba(5, 150, 105, .3);
}

.product button.in-cart-btn:hover {
    box-shadow: 0 12px 24px rgba(5, 150, 105, .42);
}

/* ---------- Filters ---------- */
.catalog-bar {
    max-width: 1240px;
    margin: 0 auto 1.3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem 1rem;
    flex-wrap: wrap;
}

.filters {
    display: flex;
    gap: .55rem;
    flex-wrap: wrap;
    min-width: 0;
}

.filters-extra {
    align-items: center;
    gap: .5rem;
    padding: .4rem;
    background: #eef1f7;
    border-radius: 16px;
}

.sort-select {
    appearance: none;
    -webkit-appearance: none;
    border: 1.5px solid var(--accent);
    background-color: var(--surface);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M3 6h18M6 12h12M10 18h4'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%234f46e5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: left .8rem center, right .75rem center;
    background-size: 15px 15px, 12px 12px;
    color: var(--accent);
    font: inherit;
    font-weight: 700;
    font-size: .88rem;
    padding: .5rem 2.1rem .5rem 2.35rem;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: border-color .2s ease, color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.sort-select:hover, .sort-select:focus {
    background-color: var(--accent-soft);
    color: var(--accent);
    outline: none;
    box-shadow: 0 6px 16px rgba(79, 70, 229, .18);
}

.filter-chip {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    font-size: .88rem;
    padding: .5rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

.filter-chip span {
    background: #f1f5f9;
    color: var(--muted);
    border-radius: 999px;
    padding: .05rem .5rem;
    font-size: .75rem;
    font-weight: 700;
    transition: background .2s ease, color .2s ease;
}

.filter-chip:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 6px 16px rgba(79, 70, 229, .14);
}

.filter-chip.active {
    background: var(--accent-grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 18px rgba(79, 70, 229, .3);
}

.filter-chip.active span { background: rgba(255, 255, 255, .22); color: #fff; }

.results-count {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
}

.products .empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted);
    font-weight: 600;
    padding: 3rem 1.5rem;
    background: var(--surface);
    border: 1.5px dashed var(--line);
    border-radius: var(--radius);
}

/* ---------- Search ---------- */
.search-box { flex: 1 1 100%; }

.search-input {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    font-size: .92rem;
    padding: .65rem 1rem .65rem 2.6rem;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='9' cy='9' r='5.5' fill='none' stroke='%2364748b' stroke-width='1.8'/%3E%3Cpath d='M13.2 13.2 17 17' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 17px 17px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.search-input::placeholder { color: var(--muted); font-weight: 600; }

.search-input:hover,
.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 6px 16px rgba(79, 70, 229, .14);
}

/* ---------- Favorites ---------- */
.product .fav-btn {
    position: absolute;
    top: .7rem;
    right: .7rem;
    z-index: 2;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, color .15s ease, background .15s ease;
}

.product .fav-btn:hover { transform: scale(1.12); color: var(--red); background: #fff; }
.product .fav-btn.active { color: var(--red); background: #fff1f2; }

.pv-fav {
    position: absolute;
    top: .85rem;
    right: 3.3rem;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(241, 245, 249, .92);
    color: #94a3b8;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.pv-fav:hover { background: #fff; color: var(--red); transform: scale(1.08); }
.pv-fav.active { color: var(--red); background: #fff1f2; }

/* ---------- Load more ---------- */
.load-more-wrap {
    max-width: 1240px;
    margin: 1.6rem auto 0;
    display: flex;
    justify-content: center;
}

.load-more-wrap[hidden] { display: none; }

.load-more-status {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 600;
}

.load-more-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: lm-spin .7s linear infinite;
}

@keyframes lm-spin { to { transform: rotate(360deg); } }

/* ---------- Scroll to top ---------- */
#to-top {
    position: fixed;
    right: clamp(1rem, 3vw, 2rem);
    bottom: clamp(1rem, 3vw, 2rem);
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--accent-grad);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(79, 70, 229, .38);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease, filter .2s ease;
}

#to-top svg { width: 24px; height: 24px; }

#to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#to-top:hover { filter: brightness(1.08); transform: translateY(-2px); }
#to-top:active { transform: translateY(0); }

/* ---------- Overlays ---------- */
.overlay, .overlay-admin {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 50;
}

.overlay.open, .overlay-admin.open { opacity: 1; visibility: visible; }

/* ---------- Cart panel ---------- */
.cart-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 390px;
    max-width: 100%;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    transform: translateX(105%);
    transition: transform .35s cubic-bezier(.32, .72, 0, 1);
    z-index: 100;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.cart-panel.open { transform: translateX(0); }

.cart-panel h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 1rem; }

#cart-items { flex: 1 1 auto; }

.cart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    color: var(--muted);
    font-weight: 600;
    text-align: center;
}

.cart-footer { margin-top: auto; }

.cart-note {
    margin: .6rem 0 .4rem;
    padding: .65rem .85rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    color: #b45309;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
}

.cart-item {
    display: flex;
    gap: .85rem;
    padding: .8rem;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: .7rem;
}

.cart-item img { width: 58px; height: 58px; object-fit: cover; border-radius: 10px; background: #eef1f7; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title { font-weight: 700; font-size: .92rem; }
.cart-item-price { color: var(--green); font-weight: 700; font-size: .9rem; margin-top: .15rem; }

.cart-item-sum { color: var(--muted); font-weight: 600; }

.cart-item-qty { display: flex; align-items: center; gap: .55rem; margin-top: .5rem; }

.cart-item-qty button.cart-item-remove {
    width: auto;
    height: 34px;
    margin-left: auto;
    padding: 0 .7rem;
    font-size: .85rem;
    font-weight: 700;
    color: #b91c1c;
}

.cart-item-qty button.cart-item-remove:hover { border-color: #fecaca; color: #b91c1c; background: #fef2f2; }

.cart-changes {
    margin-bottom: .8rem;
    padding: .7rem .9rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    color: #1e3a8a;
    font-size: .88rem;
    line-height: 1.4;
}

.cart-changes ul { margin: .3rem 0 0 1.1rem; }

.cart-item-qty button {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: var(--muted);
    transition: all .15s ease;
}

.cart-item-qty button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.cart-item-qty span { font-weight: 700; min-width: 1.4rem; text-align: center; font-size: .95rem; }

.cart-total {
    padding-top: 1.1rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -.02em;
    text-align: right;
    border-top: 1px dashed var(--line);
}

.checkout-btn, .close-cart {
    width: 100%;
    border: none;
    padding: .85rem;
    border-radius: 13px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, filter .2s ease, background .2s ease;
}

.checkout-btn {
    margin-top: 1rem;
    background: var(--accent-grad);
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 10px 22px rgba(79, 70, 229, .32);
}

.checkout-btn:hover { transform: translateY(-2px); filter: brightness(1.07); }

.close-cart { margin-top: .6rem; background: #f1f5f9; color: var(--muted); }
.close-cart:hover { background: #e6ebf3; color: var(--text); }

/* ---------- Admin panel ---------- */
.admin-panel {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 560px;
    max-width: 100%;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    transform: translateX(-105%);
    transition: transform .35s cubic-bezier(.32, .72, 0, 1);
    z-index: 100;
    overflow-y: auto;
}

.admin-panel.open { transform: translateX(0); }

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.admin-header h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }

.close-admin {
    background: #fff1f2;
    color: var(--red);
    border: none;
    padding: .45rem .95rem;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    font-size: .88rem;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

.close-admin:hover { background: var(--red); color: #fff; transform: translateY(-1px); }

.admin-page {
    background: #eef1f7;
}

.admin-page .admin-panel {
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    transform: none;
    border-radius: 0;
    box-shadow: none;
    padding: clamp(1rem, 2.5vw, 2.4rem);
}

.admin-page .admin-panel > .admin-header,
.admin-page .admin-panel > .admin-sync,
.admin-page .admin-panel > .admin-tabs,
.admin-page .admin-panel > .admin-content {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

.admin-login {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    background: linear-gradient(135deg, #1e293b, #0f172a);
}

.admin-login[hidden] { display: none; }

.admin-login-box {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 18px;
    padding: 1.8rem 1.6rem;
    box-shadow: 0 30px 70px rgba(2, 6, 23, .45);
}

.admin-login-box h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.admin-login-sub { color: var(--muted); font-size: .85rem; margin: .3rem 0 1.1rem; }
.admin-login-btn { width: 100%; }
.admin-login-error { color: var(--red); font-size: .85rem; font-weight: 700; margin-top: .6rem; min-height: 1.1em; }

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-who { font-size: .82rem; font-weight: 700; color: var(--muted); }

.badge-super {
    display: inline-block;
    margin-left: .4rem;
    padding: .1rem .5rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #7c3aed;
    background: #ede9fe;
}

.admin-page .close-admin {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.admin-page .admin-panel {
    box-shadow: 0 0 0 1px var(--line), 24px 0 60px rgba(15, 23, 42, .08);
}

.admin-sync {
    margin: -.4rem 0 1rem;
    padding: .6rem .9rem;
    border-radius: 11px;
    font-size: .84rem;
    font-weight: 700;
    background: #f1f5f9;
    color: var(--muted);
    animation: fadeUp .2s ease;
}

.admin-sync.saving { background: var(--accent-soft); color: var(--accent); }
.admin-sync.ok { background: #ecfdf5; color: var(--green); }
.admin-sync.error { background: #fff1f2; color: var(--red); }

/* ---------- Dashboard ---------- */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .6rem;
    margin-bottom: 1.1rem;
}

.dash-card {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: .85rem 1rem;
}

.dash-num {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--accent);
    line-height: 1.1;
}

.dash-label {
    font-size: .78rem;
    color: var(--muted);
    font-weight: 600;
    margin-top: .2rem;
}

.dash-section { margin-top: 1.1rem; }

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: .6rem;
}

.chart-card {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: .85rem 1rem;
}

.chart-title {
    font-size: .74rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .7rem;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 110px;
}

.chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    height: 100%;
    min-width: 0;
}

.chart-bar {
    width: 100%;
    max-width: 22px;
    min-height: 3px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, #818cf8, #4f46e5);
}

#chart-revenue .chart-bar { background: linear-gradient(180deg, #4ade80, #16a34a); }
.chart-col-label { font-size: .66rem; color: var(--muted); font-weight: 600; }

#chart-statuses {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 110px;
}

.donut {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 11px #f8fafc;
}

.donut-legend { display: flex; flex-direction: column; gap: .32rem; flex: 1; min-width: 0; }

.donut-legend-row { display: flex; align-items: center; gap: .45rem; font-size: .8rem; }
.donut-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-name { font-weight: 600; color: #334155; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend-val { font-weight: 800; }
.dash-section h3 { font-size: .95rem; font-weight: 800; margin-bottom: .6rem; letter-spacing: -.01em; }

.dash-list { display: flex; flex-direction: column; gap: .5rem; }

.dash-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .8rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .7rem .85rem;
    font-size: .85rem;
    box-shadow: var(--shadow-sm);
}

.dash-row-main { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.dash-row-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row-sub { font-size: .76rem; color: var(--muted); }
.dash-row-comment { font-size: .76rem; color: var(--green); font-style: italic; }
.dash-row-val { font-weight: 700; color: var(--green); white-space: nowrap; flex-shrink: 0; }

/* ---------- Ranking tab ---------- */
.rank-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.2rem;
}

.rank-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.rank-panel-head h3 {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -.01em;
}

.rank-panel-head p {
    font-size: .84rem;
    color: var(--muted);
    margin-top: .25rem;
    max-width: 70ch;
}

.rank-count {
    flex-shrink: 0;
    font-size: .78rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: .32rem .75rem;
    white-space: nowrap;
}

.rank-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.rank-group {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: .85rem .95rem;
}

.rank-group-title {
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    margin-bottom: .75rem;
}

.rank-fields { display: flex; flex-direction: column; gap: .7rem; }

.rank-field { display: block; }

.rank-field-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
}

.rank-field-label {
    font-size: .86rem;
    font-weight: 700;
}

.rank-field input {
    width: 96px;
    flex-shrink: 0;
    text-align: right;
    padding: .42rem .55rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    font: inherit;
    font-size: .88rem;
    font-weight: 700;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.rank-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.rank-field small {
    display: block;
    font-size: .72rem;
    color: var(--muted);
    margin-top: .28rem;
}

.rank-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: 1.15rem;
}

/* ---------- Ranking preview list ---------- */
.rank-list { display: flex; flex-direction: column; gap: .5rem; }

.rank-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .7rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: .55rem .8rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .15s ease, border-color .15s ease;
}

.rank-row:hover { border-color: #d7dbea; box-shadow: 0 6px 18px rgba(15, 23, 42, .09); }

.rank-handle {
    flex-shrink: 0;
    color: #b6bfd4;
    font-size: 1.15rem;
    line-height: 1;
    cursor: grab;
    user-select: none;
    transition: color .15s ease;
}

.rank-row:hover .rank-handle { color: var(--accent); }
.rank-row:active .rank-handle { cursor: grabbing; }

.rank-pos {
    flex-shrink: 0;
    width: 1.7rem;
    height: 1.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 800;
    font-size: .82rem;
}

.rank-row:nth-child(1) .rank-pos { background: var(--accent-grad); color: #fff; }
.rank-row:nth-child(2) .rank-pos,
.rank-row:nth-child(3) .rank-pos { background: rgba(79, 70, 229, .22); }

.rank-thumb {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    background: linear-gradient(180deg, #f8fafc 0%, #eef1f7 100%);
    border: 1px solid var(--line);
}

.rank-main { flex: 1 1 200px; min-width: 0; }

.rank-title {
    font-weight: 700;
    font-size: .9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .22rem;
    font-size: .74rem;
    color: var(--muted);
}

.rank-stat b { color: #475569; font-weight: 700; }

.rank-cat {
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    padding: .1rem .5rem;
    border-radius: 999px;
}

.rank-tag {
    font-weight: 700;
    padding: .1rem .5rem;
    border-radius: 999px;
    background: #eef1f7;
    color: #475569;
}

.rank-tag--new { background: rgba(5, 150, 105, .12); color: var(--green); }
.rank-tag--hit { background: rgba(217, 119, 6, .14); color: #92400e; }
.rank-tag--oos { background: rgba(225, 29, 72, .1); color: var(--red); }
.rank-tag--pin { background: var(--accent-soft); color: var(--accent); }

.rank-score {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .3rem;
    min-width: 92px;
}

.rank-score-val {
    font-weight: 800;
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
}

.rank-bar {
    display: block;
    width: 92px;
    height: 6px;
    border-radius: 999px;
    background: #eef1f7;
    overflow: hidden;
}

.rank-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent-grad);
}

.rank-pin {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
    font-size: .72rem;
    font-weight: 700;
    color: var(--muted);
}

.rank-pin input {
    width: 72px;
    text-align: right;
    padding: .4rem .5rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    font: inherit;
    font-size: .84rem;
    font-weight: 700;
    background: #fff;
}

.rank-pin input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

.rank-row.dragging { opacity: .45; }

.rank-row.drag-over { border-color: var(--accent); }

.rank-row.drag-over-top { box-shadow: 0 -3px 0 -1px var(--accent), var(--shadow-sm); }

.rank-row.drag-over-bottom { box-shadow: 0 3px 0 -1px var(--accent), var(--shadow-sm); }

#ranking-preview.drag-active .rank-row { transition: box-shadow .12s ease, border-color .12s ease; }

@media (max-width: 560px) {
    .rank-score { margin-left: 0; width: 100%; flex-direction: row; align-items: center; justify-content: space-between; }
    .rank-bar { width: 60%; }
}

.dash-empty {
    text-align: center;
    color: var(--muted);
    font-weight: 600;
    padding: 1.2rem;
    background: #f8fafc;
    border: 1.5px dashed var(--line);
    border-radius: 12px;
    font-size: .85rem;
}

.admin-tabs {
    display: flex;
    gap: .25rem;
    background: #f1f5f9;
    padding: .3rem;
    border-radius: 14px;
    margin-bottom: 1.3rem;
}

.admin-tab {
    flex: 1;
    padding: .6rem;
    border: none;
    border-radius: 11px;
    background: transparent;
    font: inherit;
    font-weight: 700;
    font-size: .92rem;
    color: var(--muted);
    cursor: pointer;
    transition: all .2s ease;
}

.admin-tab:hover { color: var(--text); }

.admin-tab.active {
    background: #fff;
    color: var(--accent);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .1);
}

.admin-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
}

.admin-tab-badge[hidden] { display: none; }

.admin-tab.has-new-orders { color: #ef4444; }

.tab-panel { display: none; animation: fadeUp .25s ease; }
.tab-panel.active { display: block; }

.admin-content { min-height: 120px; }

.excel-tools {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin: .2rem 0 .6rem;
}

.excel-tools-title { font-weight: 700; font-size: .88rem; color: #334155; }

.btn-sm { padding: .45rem .9rem; font-size: .82rem; }

.excel-import { cursor: pointer; display: inline-flex; align-items: center; }

.excel-msg { flex-basis: 100%; font-size: .8rem; font-weight: 700; color: var(--green); }
.excel-msg.error { color: var(--red); }

.notify-recipients { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .6rem; }
.notify-recipient { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.notify-recipient .nr-chat { flex: 1 1 200px; }
.notify-recipient .nr-thread { flex: 0 1 170px; }
.notify-empty { color: var(--muted); font-size: .85rem; }
.notify-section-title { margin: 1.2rem 0 .6rem; padding-top: 1rem; border-top: 1px solid var(--line); font-weight: 800; font-size: .95rem; letter-spacing: -.01em; }

.notify-section {
    background: #fafafa;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.25rem 1.25rem 1rem;
    margin-bottom: 1rem;
}
.notify-section legend {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 800;
    font-size: .95rem;
    color: #1e293b;
    padding: 0 .4rem;
    margin-bottom: .5rem;
}
.notify-section legend svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.notify-section .form-group:last-child { margin-bottom: 0; }

.notify-actions {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding-top: .5rem;
    margin-top: .5rem;
    border-top: 1px solid var(--line);
}
.notify-test-buttons {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}
.notify-test-buttons .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.notify-test-buttons .btn-secondary svg { width: 16px; height: 16px; flex-shrink: 0; }

@media (max-width: 560px) {
    .notify-recipient .nr-thread { flex-basis: 100%; }
    .notify-test-buttons { width: 100%; }
    .notify-test-buttons .btn-secondary { flex: 1; justify-content: center; }
}

.admin-filter {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin: 1rem 0 .6rem;
    flex-wrap: wrap;
}

.admin-filter label { font-weight: 700; font-size: .88rem; color: #334155; white-space: nowrap; }

.price-toggle-row {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin: 0 0 1.1rem;
}

.price-toggle {
    align-self: flex-start;
    border: 1.5px solid var(--line);
    background: #fff;
    color: #334155;
    font: inherit;
    font-weight: 700;
    font-size: .9rem;
    padding: .55rem 1.15rem;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: border-color .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease;
}

.price-toggle:hover { border-color: var(--accent); color: var(--accent); }

.price-toggle.active {
    background: #fef2f2;
    border-color: #f43f5e;
    color: #e11d48;
    box-shadow: 0 6px 16px rgba(244, 63, 94, .18);
}

.price-toggle-hint { font-size: .8rem; color: #64748b; font-weight: 600; }

.admin-filter select {
    font: inherit;
    font-size: .85rem;
    font-weight: 700;
    padding: .45rem .9rem;
    border-radius: 999px;
    border: 1.5px solid var(--line);
    background: #fff;
    color: #334155;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
}

.admin-filter select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
    display: block;
    margin-bottom: .4rem;
    font-weight: 700;
    font-size: .88rem;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .7rem .85rem;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font: inherit;
    font-size: .95rem;
    background: #fbfcfe;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: var(--ring);
}

.form-group input[type="file"] {
    border-style: dashed;
    border-color: #c7cede;
    background: #f8fafc;
    padding: .8rem;
    cursor: pointer;
}

.form-group input[type="file"]:focus { border-color: var(--accent); border-style: solid; }

.form-group textarea { resize: vertical; min-height: 90px; }
.form-group small { display: block; color: var(--muted); font-size: .8rem; margin-top: .4rem; }
.form-group .field-hint[hidden] { display: none; }
.field-hint { color: #b45309; font-weight: 500; }

.form-group label.checkbox-label {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: 0;
    font-size: .92rem;
    color: #334155;
    cursor: pointer;
    user-select: none;
}

.form-group label.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    margin: 0;
    padding: 0;
    border: 1.5px solid #c7cede;
    border-radius: 6px;
    background-color: #fbfcfe;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.form-group label.checkbox-label input[type="checkbox"]:hover { border-color: var(--accent); }

.form-group label.checkbox-label input[type="checkbox"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.form-group label.checkbox-label input[type="checkbox"]:checked {
    background-color: var(--accent);
    border-color: var(--accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 13px 13px;
}

.photo-preview-admin { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: .7rem; }
.photo-thumb { position: relative; }

/* PDF attachments in the blog editor */
.blog-pdf-list { display: flex; flex-direction: column; gap: .45rem; margin-top: .7rem; }
.blog-pdf-empty {
    padding: .55rem .7rem;
    border: 1px dashed var(--line);
    border-radius: 10px;
    color: var(--muted);
    font-size: .78rem;
}
.blog-pdf-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .65rem;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #f8fafc;
}
.blog-pdf-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 33px;
    height: 33px;
    border-radius: 8px;
    background: #fbecea;
    color: #a84338;
    font-size: .56rem;
    font-weight: 900;
    letter-spacing: .03em;
}
.blog-pdf-info { display: flex; flex-direction: column; gap: .1rem; flex: 1; min-width: 0; }
.blog-pdf-name { overflow: hidden; font-size: .82rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.blog-pdf-meta { color: var(--muted); font-size: .71rem; }
.blog-pdf-remove {
    flex-shrink: 0;
    padding: .3rem .55rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font: inherit;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
}
.blog-pdf-remove:hover { border-color: var(--red); color: var(--red); }

.photo-thumb.logo-thumb img {
    width: auto;
    height: 60px;
    max-width: 150px;
    object-fit: contain;
    background: #f8fafc;
}

.logo-empty {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 600;
    align-self: center;
}

.photo-thumb img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 12px;
    border: 1.5px solid var(--line);
    display: block;
    box-shadow: var(--shadow-sm);
}

.btn-remove-photo {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 21px;
    height: 21px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease;
}

.btn-remove-photo:hover { transform: scale(1.15); }

.btn-primary, .btn-secondary {
    border: none;
    padding: .7rem 1.3rem;
    border-radius: 12px;
    font: inherit;
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
    transition: transform .15s ease, filter .2s ease, background .2s ease;
}

.btn-primary {
    background: var(--accent-grad);
    color: #fff;
    box-shadow: 0 8px 18px rgba(79, 70, 229, .28);
}

.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.07); }
.btn-primary:disabled { filter: grayscale(.5); opacity: .7; cursor: wait; transform: none; }

.btn-secondary { background: #f1f5f9; color: var(--muted); }
.btn-secondary:hover { background: #e6ebf3; color: var(--text); }

/* ---------- Lists ---------- */
.list { margin-top: 1.6rem; }
.list h3 { font-size: 1rem; font-weight: 800; margin-bottom: .7rem; letter-spacing: -.01em; }

.list-item {
    background: var(--surface);
    padding: .9rem 1rem;
    margin-bottom: .65rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .8rem;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.list-item:hover { border-color: #cdd6ee; box-shadow: 0 6px 18px rgba(15, 23, 42, .08); }
.list-item.is-off { background: #f8fafc; }
.list-item.is-off .list-item-name { color: var(--muted); }

.cat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 .45rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: .74rem;
    font-weight: 800;
}
.list-item.is-off { background: #f8fafc; box-shadow: none; }
.list-item.is-off .list-item-name { color: var(--muted); }
.list-item-info { flex: 1; min-width: 0; }
.list-item-name { font-weight: 700; font-size: .95rem; }

.cat-thumb {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 9px;
    margin-right: .45rem;
    vertical-align: middle;
    border: 1px solid var(--line);
}

.btn-order {
    width: 26px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--muted);
    font-size: .72rem;
    line-height: 1;
    cursor: pointer;
}
.btn-order:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-order:disabled { opacity: .35; cursor: not-allowed; }

.cat-preview {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: .9rem 1rem;
    margin-bottom: 1.1rem;
}
.cat-preview-head b { font-size: .95rem; }
.cat-preview-head small { display: block; margin-top: .2rem; color: var(--muted); font-size: .8rem; }
.cat-preview-strip { display: flex; gap: .6rem; overflow-x: auto; padding-top: .75rem; }
.cat-preview.is-empty .cat-preview-strip { display: none; }
.cat-preview-card {
    position: relative;
    width: 118px;
    flex: 0 0 auto;
    padding: 0 0 .3rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    overflow: hidden;
}
.cat-preview-card:hover { border-color: var(--accent); }
.cat-preview-photo { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.cat-preview-photo img { display: block; width: 100%; height: 64px; object-fit: cover; }
.cat-preview-name {
    display: block;
    padding: .35rem .45rem .15rem;
    font-size: .74rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cat-preview-actions { display: flex; gap: .3rem; justify-content: center; padding-top: .2rem; }
.cat-preview-actions .btn-order { width: 38px; }
.cat-preview-num {
    position: absolute;
    top: .3rem;
    left: .3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .75);
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
}

.cat-table {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
}
.cat-table-head,
.cat-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 90px 84px 170px auto;
    gap: .8rem;
    align-items: center;
    padding: .7rem 1rem;
}
.cat-table-head {
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.cat-table-head > :last-child { text-align: right; }
.cat-row { border-bottom: 1px solid var(--line); }
.cat-row:last-child { border-bottom: 0; }
.cat-row:hover { background: var(--bg); }
.cat-row.is-off { opacity: .62; }
.cat-row-name { min-width: 0; display: flex; flex-direction: column; gap: .18rem; }
.cat-name-line { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.cat-name { font-weight: 700; font-size: .93rem; line-height: 1.25; }
.cat-row-sub { color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-row-count { color: var(--muted); font-size: .78rem; }
.cat-row-count b { color: var(--text); }
.cat-row-order { display: flex; }
.cat-order-select {
    width: 64px;
    padding: .32rem .4rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .82rem;
    cursor: pointer;
}
.cat-order-select:disabled { opacity: .45; cursor: not-allowed; }
.cat-order-none { padding-left: .5rem; color: var(--muted); font-size: .85rem; }
.cat-row-actions { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }

@media (max-width: 900px) {
    .cat-table { background: none; border: 0; border-radius: 0; overflow: visible; }
    .cat-table-head { display: none; }
    .cat-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .5rem .7rem;
        margin-bottom: .6rem;
        padding: .8rem .9rem;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 14px;
    }
    .cat-row:last-child { border-bottom: 1px solid var(--line); }
    .cat-row-name { flex: 1 1 auto; }
    .cat-row-count { flex: 0 0 auto; }
    .cat-flag { order: 5; }
    .cat-row-actions { flex: 1 1 100%; justify-content: flex-start; order: 6; }
}

.cover-view {
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
    overflow-y: auto;
}
.cover-view.open { opacity: 1; visibility: visible; }
.cover-dialog {
    position: relative;
    width: min(540px, 100%);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1.4rem;
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.cover-dialog h3 { font-size: 1.1rem; font-weight: 800; padding-right: 2.4rem; }
.cover-hint { margin-top: .3rem; color: var(--muted); font-size: .82rem; }
.cover-field { margin-top: 1rem; }
.cover-field label { display: block; margin-bottom: .3rem; font-size: .8rem; font-weight: 700; }
.cover-field select {
    width: 100%;
    padding: .6rem .7rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    font: inherit;
}
.cover-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: .55rem;
    margin-top: .9rem;
}
.cover-photo {
    position: relative;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg);
    aspect-ratio: 1;
    cursor: pointer;
}
.cover-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-photo:hover { border-color: var(--accent); }
.cover-photo.is-active { border-color: var(--accent); }
.cover-check {
    position: absolute;
    top: .25rem;
    right: .25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
}
.cover-empty { margin-top: .8rem; color: var(--muted); font-size: .85rem; }
.cover-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.cover-actions .btn-primary { margin-left: auto; }

.cat-thumb-btn { border: 0; background: none; padding: 0; margin-right: .5rem; vertical-align: middle; cursor: pointer; }
.cat-thumb-btn:hover .cat-thumb { border-color: var(--accent); }
.cat-thumb-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1.5px dashed #c7cede;
    border-radius: 9px;
    background: #fbfcfe;
    color: var(--muted);
    font-weight: 800;
    font-size: 1rem;
}
.cat-thumb-btn:hover .cat-thumb-empty { border-color: var(--accent); color: var(--accent); }

.admin-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem 1.1rem 1.1rem;
    margin-bottom: 1.2rem;
}
.admin-card-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.admin-card-head h3 { font-size: 1.05rem; font-weight: 800; }
.admin-card-head p { margin-top: .35rem; color: var(--muted); font-size: .84rem; max-width: 70ch; }

/* Rich text editor (blog article) */
.rte {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.rte:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem;
    padding: .42rem .45rem;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}
.rte-group { display: flex; flex-wrap: wrap; align-items: center; gap: .18rem; }
.rte-group + .rte-group { margin-left: .12rem; padding-left: .35rem; border-left: 1px solid var(--line); }
.rte-btn {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.2;
    padding: .32rem .45rem;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
}
.rte-btn:hover { background: #fff; border-color: var(--line); }
.rte-btn:active, .rte-btn.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.rte-btn--photo { background: var(--accent-soft); color: var(--accent); }
.rte-btn--danger { color: var(--red); }
.rte-image-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem .6rem;
    padding: .45rem .55rem;
    border-bottom: 1px solid var(--line);
    background: #fff;
}
.rte-image-panel[hidden] { display: none; }
.rte-image-panel-label {
    color: var(--accent);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.rte-image-panel .rte-btn { border-color: var(--line); background: #fff; }
.rte-image-panel .rte-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.rte-alt {
    display: flex;
    flex: 1 1 200px;
    align-items: center;
    gap: .35rem;
    color: var(--muted);
    font-size: .74rem;
    font-weight: 700;
}
.rte-alt input {
    flex: 1;
    min-width: 100px;
    padding: .28rem .45rem;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: .8rem;
}
.rte-alt input:focus { outline: none; border-color: var(--accent); }
.rte-editor {
    min-height: 270px;
    max-height: 560px;
    overflow: auto;
    padding: .85rem 1rem;
    color: var(--text);
    font-size: .95rem;
    line-height: 1.68;
    outline: none;
}
.rte-editor:empty::before { content: attr(data-placeholder); color: #9aa3b2; pointer-events: none; }
.rte-editor p, .rte-editor div { margin: 0 0 .8em; }
.rte-editor p:last-child { margin-bottom: 0; }
.rte-editor h2 { margin: .9em 0 .45em; font-size: 1.35rem; line-height: 1.25; }
.rte-editor h3 { margin: .8em 0 .4em; font-size: 1.12rem; line-height: 1.3; }
.rte-editor ul, .rte-editor ol { margin: 0 0 .8em 1.35em; padding: 0; }
.rte-editor li { margin: .2em 0; }
.rte-editor blockquote {
    margin: .8em 0;
    padding: .55em .9em;
    border-left: 3px solid var(--accent);
    border-radius: 0 10px 10px 0;
    background: var(--accent-soft);
}
.rte-editor a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.rte-editor img { cursor: pointer; }
.rte-editor img.is-selected { outline: 3px solid var(--accent); outline-offset: 2px; }
.rte-editor::after { content: ''; display: table; clear: both; }
@media (max-width: 640px) {
    .rte-editor { min-height: 220px; padding: .7rem .75rem; }
    .rte-btn { padding: .3rem .38rem; }
}

.list-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.list-head h3 { font-size: 1.05rem; font-weight: 800; }
.list-head small { color: var(--muted); font-size: .8rem; }
.cat-flag { font-size: .72rem; padding: .28rem .55rem; }
.cat-flag.is-disabled { opacity: .55; cursor: not-allowed; }
.cat-flag.is-disabled input { cursor: not-allowed; }
.cat-flag.is-disabled:hover { border-color: var(--line); }

.photo-empty { color: var(--muted); font-size: .82rem; }
.list-item-meta { font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.list-item-actions { display: flex; gap: .4rem; flex-shrink: 0; align-items: center; }

.stock-edit {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    font-weight: 700;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: .28rem .5rem;
    white-space: nowrap;
}

.stock-edit input {
    width: 58px;
    border: 1px solid #d7deec;
    border-radius: 8px;
    padding: .15rem .3rem;
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    text-align: center;
    background: #f8fafc;
}

.stock-edit input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stock-edit input:focus { outline: none; border-color: var(--accent); background: #fff; }

.price-edit input { width: 74px; }

.cat-edit select {
    max-width: 160px;
    border: 1px solid #d7deec;
    border-radius: 8px;
    padding: .15rem .3rem;
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    background: #f8fafc;
    color: inherit;
}
.cat-edit select:focus { outline: none; border-color: var(--accent); background: #fff; }

.is-hidden { display: none !important; }

.product-form-head { display: flex; justify-content: flex-start; margin-bottom: .8rem; }

.btn-edit, .btn-delete, .btn-toggle, .btn-copy {
    border: none;
    padding: .4rem .8rem;
    border-radius: 9px;
    font: inherit;
    font-weight: 700;
    font-size: .8rem;
    cursor: pointer;
    transition: transform .15s ease, filter .2s ease;
}

.btn-edit { background: var(--accent-soft); color: var(--accent); }
.btn-toggle { background: #eff6ff; color: var(--accent); }
.btn-copy { background: #ecfdf5; color: #047857; }
.list-item-link { color: inherit; text-decoration: none; }
.list-item-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.btn-delete { background: #fff1f2; color: var(--red); }
.btn-edit:hover, .btn-delete:hover, .btn-toggle:hover, .btn-copy:hover { transform: translateY(-1px); filter: brightness(.97); }

.badge-hidden {
    display: inline-block;
    margin-left: .4rem;
    color: #fff;
    background: var(--muted);
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.5;
    padding: .1rem .5rem;
    border-radius: 999px;
    vertical-align: .08em;
}

.product-preview { display: flex; gap: .4rem; margin-top: .5rem; flex-wrap: wrap; }

.product-preview img {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 9px;
    border: 1px solid var(--line);
}

.specs {
    font-size: .8rem;
    color: var(--muted);
    margin-top: .5rem;
    white-space: pre-wrap;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: .5rem .65rem;
}

/* ---------- Admin: modern products tab ---------- */
.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
    flex-wrap: wrap;
    margin-bottom: .9rem;
    padding: .7rem .85rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.admin-toolbar--soft { padding: .5rem .85rem; background: #f8fafc; box-shadow: none; }
.admin-toolbar-left, .admin-toolbar-right { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.btn-new { padding: .62rem 1.1rem; border-radius: 12px; }

.tb-field {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .8rem;
    font-weight: 800;
    color: var(--muted);
}

.tb-field select {
    font: inherit;
    font-size: .85rem;
    font-weight: 700;
    padding: .45rem .8rem;
    border-radius: 10px;
    border: 1.5px solid var(--line);
    background: #fff;
    color: #334155;
    cursor: pointer;
    max-width: 200px;
}

.tb-field select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.tb-sep { width: 1px; height: 22px; background: var(--line); }
.tb-title { font-weight: 800; font-size: .74rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; }

.btn-ghost {
    font: inherit;
    font-weight: 700;
    font-size: .82rem;
    padding: .45rem .85rem;
    border-radius: 10px;
    border: 1.5px solid var(--line);
    background: #fff;
    color: #334155;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.excel-import.btn-ghost { cursor: pointer; }

.to-top {
    position: fixed;
    right: clamp(1rem, 3vw, 2.4rem);
    bottom: clamp(1rem, 3vw, 2.4rem);
    z-index: 90;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .6rem 1rem;
    border: none;
    border-radius: 999px;
    background: var(--accent-grad);
    color: #fff;
    font: inherit;
    font-weight: 800;
    font-size: .85rem;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(79, 70, 229, .35);
    transition: transform .15s ease, filter .2s ease, opacity .2s ease;
}

.to-top[hidden] { display: none; }
.to-top:hover { transform: translateY(-2px); filter: brightness(1.07); }
.to-top .to-top-arrow { font-size: 1rem; line-height: 1; }

.btn-ghost.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.bulk-price,
.bulk-stock {
    display: flex;
    align-items: flex-end;
    gap: .8rem;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: .8rem .9rem;
    margin-bottom: .9rem;
    box-shadow: var(--shadow-sm);
}

.bulk-field { display: flex; flex-direction: column; gap: .3rem; }
.bulk-field label { font-size: .74rem; font-weight: 800; color: var(--muted); }

.bulk-field select, .bulk-field input {
    font: inherit;
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
    border: 1.5px solid var(--line);
    border-radius: 10px;
    padding: .5rem .6rem;
    background: #f8fafc;
    min-width: 150px;
}

.bulk-field input { width: 130px; }
.bulk-field select:focus, .bulk-field input:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: var(--ring); }
.bulk-hint { font-size: .82rem; font-weight: 700; color: var(--muted); margin-left: auto; align-self: center; }
.bulk-price .pf-close,
.bulk-stock .pf-close { align-self: center; }

.admin-search {
    display: flex;
    align-items: center;
    gap: .45rem;
    background: #f8fafc;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: .45rem .6rem;
    min-width: 280px;
    color: var(--muted);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.admin-search:focus-within { border-color: var(--accent); background: #fff; box-shadow: var(--ring); }
.admin-search svg { flex: none; color: var(--muted); }
.admin-search input {
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    min-width: 0;
}
.admin-search input::-webkit-search-cancel-button { display: none; }

.admin-search-clear {
    flex: none;
    border: none;
    background: var(--line);
    color: var(--muted);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: .9rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}
.admin-search-clear:hover { background: var(--accent); color: #fff; }

.pcards-empty {
    padding: 1.4rem 1rem;
    text-align: center;
    font-weight: 700;
    color: var(--muted);
    background: #f8fafc;
    border: 1px dashed var(--line);
    border-radius: 14px;
}

.pf-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .9rem; }
.pf-head h3 { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }

.pf-close {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #f8fafc;
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease;
}

.pf-close:hover { background: var(--red); color: #fff; border-color: transparent; }

#product-form {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.15rem 1.2rem 1.1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.1rem;
}

.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
.pf-grid .form-group { margin-bottom: .85rem; }
.form-group--full { grid-column: 1 / -1; }
.form-check { display: flex; align-items: flex-end; }
.form-check .checkbox-label { margin-bottom: .35rem; }
.pf-actions { display: flex; gap: .6rem; margin-top: .2rem; }

.pcards-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.pcards-head h3 { font-size: 1.05rem; font-weight: 800; }

.pcards-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 24px;
    padding: 0 .5rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: .8rem;
    font-weight: 800;
}

.pcard {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: .95rem 1rem;
    margin-bottom: .7rem;
    box-shadow: var(--shadow-sm);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.pcard:hover { border-color: #cdd6ee; box-shadow: 0 12px 30px rgba(15, 23, 42, .1); transform: translateY(-1px); }

.pcard-media {
    width: 84px;
    height: 84px;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5f9, #e9edf6);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcard-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-noimg { font-size: .72rem; color: var(--muted); font-weight: 700; }
.pcard-body { min-width: 0; }
.pcard-name { font-weight: 800; font-size: 1rem; letter-spacing: -.01em; line-height: 1.3; }

.badge-new {
    display: inline-block;
    margin-left: .4rem;
    color: #fff;
    background: var(--accent-grad);
    font-size: .68rem;
    font-weight: 800;
    line-height: 1.5;
    padding: .1rem .5rem;
    border-radius: 999px;
    vertical-align: .08em;
}

.badge-hit {
    display: inline-block;
    margin-left: .4rem;
    color: #fff;
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    font-size: .68rem;
    font-weight: 800;
    line-height: 1.5;
    padding: .1rem .5rem;
    border-radius: 999px;
    vertical-align: .08em;
    white-space: nowrap;
}

.badge-sale {
    display: inline-block;
    margin-left: .4rem;
    color: #fff;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    font-size: .68rem;
    font-weight: 800;
    line-height: 1.5;
    padding: .1rem .5rem;
    border-radius: 999px;
    vertical-align: .08em;
    white-space: nowrap;
}

.pcard-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }

.pcard-price {
    margin-top: .45rem;
    font-size: 1.02rem;
    font-weight: 800;
    color: #cb11ab;
    letter-spacing: -.01em;
}
.pcard-price .price-old { font-size: .8em; font-weight: 600; }
.pcard-price-empty { color: var(--muted); font-size: .82rem; font-weight: 600; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid var(--line);
    padding: .22rem .6rem;
    border-radius: 999px;
}

.chip-cat { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip-stock { background: #ecfdf5; color: var(--green); border-color: transparent; }
.chip-danger { background: #fef2f2; color: var(--red); }

.pcard-specs { margin-top: .6rem; }

.pcard-specs summary {
    cursor: pointer;
    font-size: .8rem;
    font-weight: 700;
    color: var(--muted);
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .15rem 0;
}

.pcard-specs summary::-webkit-details-marker { display: none; }
.pcard-specs summary::before { content: '▸'; font-size: .9rem; transition: transform .2s ease; }
.pcard-specs[open] summary::before { transform: rotate(90deg); }
.pcard-specs .specs { margin-top: .4rem; }

.pcard-side { display: flex; flex-direction: column; gap: .55rem; min-width: 260px; }
.pcard-fields { display: grid; grid-template-columns: 1fr; gap: .5rem; }

/* Метки «Новинка» и «Хит» прямо в списке карточек */
.pcard-flags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding-top: .5rem;
    border-top: 1px dashed var(--line);
}

.pflag {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .74rem;
    font-weight: 800;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .32rem .6rem;
    cursor: pointer;
    user-select: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.pflag:hover { border-color: #c7cede; }
.pflag input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.pflag:has(input:checked) { color: #315544; background: #eef3e9; border-color: #b9cbb8; }
.pflag-hit input { accent-color: #b45309; }
.pflag-hit:has(input:checked) { color: #92400e; background: #fdf3e3; border-color: #eccf9f; }
.pflag:has(input:focus-visible) { box-shadow: var(--ring); }

.pfield {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    font-size: .78rem;
    font-weight: 800;
    color: var(--muted);
}

.pfield > span { white-space: nowrap; }

.pfield select, .pfield input {
    font: inherit;
    font-size: .85rem;
    font-weight: 700;
    color: var(--text);
    border: 1.5px solid var(--line);
    border-radius: 10px;
    padding: .4rem .55rem;
    background: #f8fafc;
    width: 150px;
    max-width: 55%;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.pfield-num input { width: 110px; text-align: right; }
.pfield select:focus, .pfield input:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: var(--ring); }
.pcard-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.pcard-actions .btn-edit, .pcard-actions .btn-toggle, .pcard-actions .btn-delete, .pcard-actions .btn-copy { flex: 1; }

@media (max-width: 720px) {
    .pf-grid { grid-template-columns: 1fr; }
    .pcard { grid-template-columns: 64px minmax(0, 1fr); }
    .pcard-media { width: 64px; height: 64px; }
    .pcard-side { grid-column: 1 / -1; min-width: 0; }
    .pfield select, .pfield input { max-width: 60%; }
}

/* ---------- Product detail view ---------- */
.product-view {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(.75rem, 3vw, 2rem);
    background: rgba(15, 23, 42, .52);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    overflow-y: auto;
}

.product-view.open { opacity: 1; visibility: visible; }

.pv-dialog {
    position: relative;
    background: var(--surface);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    width: min(920px, 100%);
    max-height: calc(100vh - 2 * clamp(.75rem, 3vw, 2rem));
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    transform: translateY(16px) scale(.97);
    opacity: 0;
    transition: transform .3s cubic-bezier(.32, .72, 0, 1), opacity .25s ease;
}

.product-view.open .pv-dialog { transform: none; opacity: 1; }

.pv-close {
    position: absolute;
    top: .85rem;
    right: .85rem;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(241, 245, 249, .92);
    color: var(--muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.pv-close:hover { background: var(--red); color: #fff; transform: rotate(90deg); }

.pv-gallery {
    padding: clamp(1rem, 2.5vw, 1.6rem);
    background: linear-gradient(180deg, #f8fafc 0%, #eef1f7 100%);
    border-radius: 22px 0 0 22px;
}

.pv-main {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(60vh, 520px);
    margin: 0 auto;
    object-fit: contain;
    border-radius: 16px;
    background: #eef1f7;
    box-shadow: var(--shadow-sm);
    cursor: zoom-in;
}

.photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(.5rem, 2vw, 1.5rem);
    background: rgba(2, 6, 23, .9);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
    cursor: zoom-out;
}

.photo-lightbox.open { opacity: 1; visibility: visible; }

.photo-lightbox img {
    max-width: 96vw;
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}

.photo-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, transform .2s ease;
}

.photo-lightbox-close:hover { background: var(--red); transform: scale(1.08); }

.pv-thumbs { display: flex; gap: .6rem; margin-top: .8rem; flex-wrap: wrap; }

.pv-thumb {
    padding: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    background: none;
    cursor: pointer;
    line-height: 0;
    transition: border-color .15s ease, transform .15s ease;
}

.pv-thumb img {
    width: 62px;
    height: 62px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.pv-thumb:hover { transform: translateY(-2px); }
.pv-thumb.active { border-color: var(--accent); }

.pv-info {
    padding: clamp(1.1rem, 2.5vw, 1.7rem);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pv-category {
    font-size: .74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent);
    background: var(--accent-soft);
    align-self: flex-start;
    padding: .22rem .6rem;
    border-radius: 999px;
    margin-bottom: .7rem;
}

.pv-category .badge-new {
    position: static;
    display: inline-block;
    margin-right: .5rem;
    padding: .18rem .55rem;
    font-size: .68rem;
    box-shadow: none;
    vertical-align: middle;
}

.pv-category .badge-hit {
    position: static;
    display: inline-block;
    margin: 0 .5rem 0 0;
    padding: .18rem .55rem;
    font-size: .68rem;
    box-shadow: none;
    vertical-align: middle;
}

.pv-article {
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: .5rem;
}

.pv-info h2 {
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.2;
    padding-right: 2.5rem;
}

.pv-price {
    margin-top: .6rem;
    font-size: 1.7rem;
    font-weight: 800;
    color: #cb11ab;
    letter-spacing: -.02em;
}

.pv-specs { margin-top: 1.1rem; display: flex; flex-direction: column; }

.pv-spec-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .55rem 0;
    border-bottom: 1px dashed var(--line);
    font-size: .92rem;
}

.pv-spec-row:first-child { border-top: 1px dashed var(--line); }
.pv-spec-key { color: var(--muted); }
.pv-spec-val { font-weight: 700; text-align: right; }

.pv-actions {
    display: flex;
    gap: .8rem;
    align-items: stretch;
    margin-top: auto;
    padding-top: 1.3rem;
}

.pv-qty {
    display: flex;
    align-items: center;
    gap: .15rem;
    background: #f8fafc;
    border: 1.5px solid var(--line);
    border-radius: 13px;
    padding: .25rem;
    flex-shrink: 0;
}

.pv-qty button {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.pv-qty button:hover { background: var(--accent-soft); color: var(--accent); }

.pv-qty span {
    min-width: 2rem;
    text-align: center;
    font-weight: 800;
    font-size: 1rem;
}

.pv-add {
    flex: 1;
    border: none;
    border-radius: 13px;
    background: var(--accent-grad);
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(79, 70, 229, .32);
    transition: transform .15s ease, filter .2s ease;
}

.pv-add:hover { transform: translateY(-2px); filter: brightness(1.07); }
.pv-add:active { transform: translateY(0); }

body.no-scroll { overflow: hidden; }

/* ---------- Checkout ---------- */
.checkout-view {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(.75rem, 3vw, 2rem);
    background: rgba(15, 23, 42, .52);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    overflow-y: auto;
}

.checkout-view.open { opacity: 1; visibility: visible; }

.co-dialog {
    position: relative;
    background: var(--surface);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    width: min(460px, 100%);
    max-height: calc(100vh - 2 * clamp(.75rem, 3vw, 2rem));
    overflow-y: auto;
    padding: 1.6rem;
    transform: translateY(16px) scale(.97);
    opacity: 0;
    transition: transform .3s cubic-bezier(.32, .72, 0, 1), opacity .25s ease;
}

.checkout-view.open .co-dialog { transform: none; opacity: 1; }

.co-close {
    position: absolute;
    top: .9rem;
    right: .9rem;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(241, 245, 249, .92);
    color: var(--muted);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.co-close:hover { background: var(--red); color: #fff; transform: rotate(90deg); }

.co-dialog h2 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: 1rem;
    padding-right: 2.2rem;
}

.co-items {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.2rem;
    max-height: 200px;
    overflow-y: auto;
}

.co-item {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    padding: .5rem 0;
    border-bottom: 1px dashed var(--line);
    font-size: .92rem;
}

.co-item:first-child { border-top: 1px dashed var(--line); }
.co-item-name { font-weight: 600; }
.co-item-price { font-weight: 700; color: var(--green); white-space: nowrap; }

.co-label {
    font-weight: 700;
    font-size: .88rem;
    color: #334155;
    margin-bottom: .5rem;
}

.co-options { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.2rem; }

.co-option {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .85rem 1rem;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.co-option:hover { border-color: var(--accent); }

.co-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: var(--ring);
}

.co-option input {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    margin: 0;
    border: 1.5px solid #c7cede;
    border-radius: 50%;
    background-color: #fbfcfe;
    cursor: pointer;
    flex-shrink: 0;
    display: grid;
    place-content: center;
    transition: border-color .15s ease, background-color .15s ease;
}

.co-option input::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: scale(0);
    transition: transform .15s ease;
    box-shadow: inset 1em 1em #fff;
}

.co-option input:checked { background-color: var(--accent); border-color: var(--accent); }
.co-option input:checked::before { transform: scale(1); }
.co-option input:focus { outline: none; box-shadow: var(--ring); }

.co-option-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.co-option-title { font-weight: 700; font-size: .95rem; }
.co-option-desc { font-size: .82rem; color: var(--muted); }

.co-comment { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.2rem; }
.co-comment label { font-weight: 700; font-size: .88rem; color: #334155; }

.co-contacts { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1.2rem; padding-top: 1.1rem; border-top: 1px dashed var(--line); }
.co-field { display: flex; flex-direction: column; gap: .35rem; }
.co-field label { font-weight: 700; font-size: .88rem; color: #334155; }

.co-field input {
    width: 100%;
    padding: .7rem .85rem;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font: inherit;
    font-size: .95rem;
    background: #fbfcfe;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.co-field input:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: var(--ring);
}

.co-address { display: flex; flex-direction: column; gap: .8rem; animation: fadeUp .2s ease; }
.co-address[hidden] { display: none; }

.dash-row-order {
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.dash-row-order:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.dash-row-order:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.dash-row-order .dash-row-title { white-space: normal; }

.dash-badge {
    display: inline-block;
    margin-left: .4rem;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1.5;
    padding: .12rem .55rem;
    border-radius: 999px;
    vertical-align: .06em;
    white-space: nowrap;
}

.order-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .8rem;
    flex-wrap: wrap;
}

.order-status-select {
    font: inherit;
    font-size: .85rem;
    font-weight: 700;
    padding: .45rem .9rem;
    border-radius: 999px;
    border: 1.5px solid var(--line);
    background: #fff;
    color: #334155;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.order-status-select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

.order-status-saved {
    min-height: 1.1rem;
    font-size: .75rem;
    color: var(--green);
    font-weight: 700;
    text-align: right;
    margin-top: .1rem;
}

.order-section { margin-top: 1.1rem; }

.order-label {
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    margin-bottom: .5rem;
}

.order-meta { display: flex; flex-direction: column; gap: .5rem; }

.order-meta-row {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    font-size: .88rem;
}

.order-meta-row span { color: var(--muted); font-weight: 600; flex-shrink: 0; }
.order-meta-row b { font-weight: 700; text-align: right; }

.order-comment {
    background: #f8fafc;
    border: 1px solid var(--line);
    padding: .7rem .85rem;
    border-radius: 10px;
    font-size: .88rem;
    color: #334155;
    font-style: italic;
    white-space: pre-wrap;
    word-break: break-word;
}

.order-items { display: flex; flex-direction: column; gap: .35rem; }

.order-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .88rem;
    padding: .4rem 0;
    border-bottom: 1px dashed var(--line);
}

.order-item:last-child { border-bottom: none; }

.order-item-img {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    background: #eef1f7;
    border: 1px solid var(--line);
    cursor: zoom-in;
}

.order-item-img--empty {
    display: block;
    background: linear-gradient(135deg, #eef1f7, #e2e8f0);
}

.order-item-info {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
    flex: 1 1 auto;
}

.order-item-name { font-weight: 600; word-break: break-word; }
.order-item-article { font-size: .76rem; font-weight: 600; color: var(--muted); }
.order-item-qty { font-size: .78rem; color: var(--muted); }
.order-item-price { font-weight: 700; color: var(--accent); white-space: nowrap; margin-left: auto; }

.order-total {
    margin-top: 1.1rem;
    text-align: right;
    font-size: 1.05rem;
    font-weight: 800;
}

.order-total span { color: var(--green); }

.order-actions {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
}

.order-delete-btn {
    font: inherit;
    font-size: .85rem;
    font-weight: 700;
    padding: .55rem 1.1rem;
    border-radius: 10px;
    border: 1.5px solid #fecdd3;
    background: #fff1f2;
    color: var(--red);
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.order-delete-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }
.order-delete-btn:disabled { opacity: .6; cursor: wait; }

.co-map-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    background: var(--accent-soft);
    padding: .4rem .75rem;
    border-radius: 999px;
    align-self: flex-start;
    transition: filter .15s ease, transform .15s ease;
}

.co-map-link:hover { filter: brightness(.96); transform: translateY(-1px); }

.co-ozon-info {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .88rem;
    font-weight: 600;
    padding: .6rem .8rem;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--text);
    border: 1px solid transparent;
}

.co-ozon-info[hidden] { display: none; }
.co-ozon-info b { font-weight: 800; }
.co-ozon-info.loading { color: var(--muted); background: #f1f5f9; }
.co-ozon-info.ok { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.co-ozon-info.error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.co-pvz-wrap { position: relative; }

.pvz-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 60;
    margin: 0;
    padding: .3rem;
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
}

.pvz-list[hidden] { display: none; }

.pvz-item {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    padding: .5rem .6rem;
    border-radius: 8px;
    cursor: pointer;
}

.pvz-item:hover, .pvz-item.active { background: var(--accent-soft); }
.pvz-item-name { font-weight: 700; font-size: .9rem; }
.pvz-item-addr { font-size: .82rem; color: var(--muted); }
.pvz-item-time { font-size: .76rem; color: var(--muted); align-self: flex-start; }

.co-ozon-phone {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .88rem;
    font-weight: 600;
    padding: .55rem .75rem;
    margin: .35rem 0;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--text);
    border: 1px solid transparent;
}

.co-ozon-phone[hidden] { display: none; }
.co-ozon-phone b { font-weight: 800; }
.co-ozon-phone.loading { color: var(--muted); background: #f1f5f9; }
.co-ozon-phone.ok { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.co-ozon-phone.error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.req { color: var(--red); }

.co-comment textarea {
    width: 100%;
    padding: .7rem .85rem;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font: inherit;
    font-size: .95rem;
    background: #fbfcfe;
    color: var(--text);
    resize: vertical;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.co-comment textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: var(--ring);
}

.co-total {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -.02em;
    text-align: right;
    padding-top: 1rem;
    border-top: 1px dashed var(--line);
    margin-bottom: 1rem;
}

.co-submit {
    width: 100%;
    border: none;
    padding: .9rem;
    border-radius: 13px;
    background: var(--accent-grad);
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(79, 70, 229, .32);
    transition: transform .15s ease, filter .2s ease;
}

.co-submit:hover { transform: translateY(-2px); filter: brightness(1.07); }
.co-submit:active { transform: translateY(0); }
.co-submit:disabled { opacity: .7; cursor: wait; transform: none; }

.co-error {
    margin-bottom: 1rem;
    padding: .75rem .9rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #b91c1c;
    font-weight: 600;
    line-height: 1.4;
}

.thanks-dialog { text-align: center; }
.thanks-dialog h2 { padding: 0 2.2rem; }

.thanks-mark {
    width: 64px;
    height: 64px;
    margin: .2rem auto 1rem;
    border-radius: 50%;
    background: #ecfdf5;
    color: #065f46;
    font-size: 2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thanks-number { font-size: 1.15rem; font-weight: 800; margin-bottom: 1rem; }

.thanks-details {
    text-align: left;
    padding: .8rem 1rem;
    margin-bottom: 1rem;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    line-height: 1.6;
}

.thanks-details span { color: var(--muted); }
.thanks-next { color: var(--muted); margin-bottom: 1rem; }

/* ---------- Responsive & a11y ---------- */
@media (min-width: 1100px) {
    .admin-panel { width: 660px; }
    .dash-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) and (max-width: 1099px) {
    .admin-panel { width: 600px; }
}

@media (max-width: 600px) {
    .topbar-inner { justify-content: center; }
    .topbar-item--dim { display: none; }
    .header-main { flex-wrap: wrap; gap: .6rem; padding: .7rem 1rem; }
    .brand { order: 1; }
    .header-actions { order: 2; margin-left: auto; }
    .header-search { order: 3; flex: 1 1 100%; max-width: none; margin: 0; }
    header h1 { font-size: 1.2rem; }
    .cart-btn, .admin-btn, .fav-btn-header { padding: .55rem .9rem; font-size: .85rem; }
    .products { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
    .product-info { padding: .6rem .65rem .7rem; gap: .3rem; }
    .product h3 { font-size: .85rem; line-height: 1.3; }
    .product .price { font-size: 1rem; }
    .product button, .product .waitlist-btn { font-size: .85rem; padding: .5rem .7rem; }
    .product-image { aspect-ratio: 4 / 3; }
    .cart-panel, .admin-panel { width: 100%; border-radius: 0; }
    .catalog-bar { flex-direction: column; align-items: stretch; gap: .6rem; margin-bottom: 1rem; }
    .filters { flex-wrap: wrap; gap: .45rem; }
    #filters { flex-wrap: wrap; gap: .45rem; }
    #filters .filter-chip { flex: 0 1 auto; max-width: 100%; }
    .filter-chip { padding: .45rem .8rem; font-size: .84rem; gap: .4rem; }
    .filter-chip span { font-size: .72rem; padding: .1rem .45rem; }
    .sort-select { font-size: .84rem; padding: .45rem 1.9rem .45rem 2.1rem; background-position: left .7rem center, right .65rem center; }
    .results-count { font-size: .8rem; }
    .pv-dialog { grid-template-columns: 1fr; }
    .pv-gallery { border-radius: 22px 22px 0 0; }
    .pv-thumb img { width: 54px; height: 54px; }
    .pv-info h2 { padding-right: 2.2rem; }
    .list-item {
        flex-direction: column;
        align-items: stretch;
        gap: .6rem;
    }
    .list-item-actions {
        width: 100%;
        flex-shrink: 1;
        flex-wrap: wrap;
    }
    .list-item-actions .btn-edit,
    .list-item-actions .btn-toggle,
    .list-item-actions .btn-delete {
        flex: 1 1 auto;
        min-width: 0;
        padding: .5rem .6rem;
        text-align: center;
    }
}

@media (max-width: 420px) {
    header h1 {
        font-size: 1.05rem;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    header h1::before { width: 28px; height: 28px; border-radius: 8px; }
    .site-logo { height: 44px; max-width: min(44vw, 190px); }
    .brand-tag { display: none; }
    .cart-text, .fav-text { display: none; }
    .header-actions { flex-shrink: 0; gap: .4rem; }
    .cart-btn, .admin-btn, .fav-btn-header { padding: .5rem .7rem; font-size: .8rem; }
    .filters { gap: .4rem; }
    .filter-chip { padding: .4rem .7rem; font-size: .8rem; }
    .sort-select { font-size: .8rem; padding: .4rem 1.8rem .4rem 1.95rem; background-position: left .65rem center, right .6rem center; background-size: 13px 13px, 11px 11px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---------- Documentation tab ---------- */
.docs {
    max-width: 920px;
    line-height: 1.6;
    color: var(--text);
}
.docs h3 {
    margin: 0 0 .8rem;
    font-size: 1.3rem;
}
.docs h4 {
    margin: 1.5rem 0 .5rem;
    font-size: 1.02rem;
    color: var(--accent);
}
.docs p {
    margin: .5rem 0 .9rem;
}
.docs ul, .docs ol {
    margin: .4rem 0 1rem;
    padding-left: 1.35rem;
}
.docs li {
    margin: .28rem 0;
}
.docs code {
    background: #eef2f7;
    border: 1px solid #dde3ec;
    border-radius: 6px;
    padding: .06em .42em;
    font-size: .86em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-word;
}
.docs table {
    width: 100%;
    border-collapse: collapse;
    margin: .5rem 0 1.1rem;
    font-size: .9rem;
}
.docs th, .docs td {
    text-align: left;
    padding: .5rem .65rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.docs th {
    background: #f1f5f9;
    font-weight: 700;
    white-space: nowrap;
}
.docs .note {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: .75rem .95rem;
    margin: 1rem 0;
    font-size: .92rem;
}

/* ---------- Nelli-Lab storefront refresh ---------- */
body {
    background:
        radial-gradient(1000px 520px at 95% -10%, rgba(210, 174, 119, .12), transparent 62%),
        radial-gradient(900px 420px at -10% 8%, rgba(88, 121, 91, .08), transparent 58%),
        var(--bg);
    color: var(--text);
}

header {
    background: rgba(255, 254, 250, .94);
    box-shadow: 0 4px 20px rgba(56, 48, 35, .045);
}

.topbar { background: #315544; }
.topbar-inner { max-width: 1360px; }
.header-main { max-width: 1360px; padding-top: .8rem; padding-bottom: .8rem; }
header h1::before { background: var(--accent-grad); box-shadow: 0 5px 14px rgba(49, 85, 68, .22); }
.brand-tag { letter-spacing: .025em; text-transform: none; }

main { padding-top: clamp(1.1rem, 2.4vw, 2rem); }
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    max-width: 1360px;
    min-height: clamp(390px, 39vw, 520px);
    margin: 0 auto 1.5rem;
    border: 1px solid rgba(84, 75, 59, .08);
    border-radius: 30px;
    background: #eee2cf url('/uploads/hero-craft.webp') 58% 52% / cover no-repeat;
    box-shadow: 0 20px 54px rgba(74, 59, 38, .12);
}
.hero::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: '';
    background: linear-gradient(90deg, rgba(251, 248, 242, .98) 0%, rgba(251, 248, 242, .94) 35%, rgba(251, 248, 242, .58) 58%, rgba(251, 248, 242, 0) 82%);
}
.hero-copy {
    width: min(100%, 720px);
    padding: clamp(2rem, 5.2vw, 5rem);
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: #527560;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .12em;
    line-height: 1.4;
    text-transform: uppercase;
}
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #c77952; }
.hero h2 {
    max-width: 650px;
    margin: .85rem 0 .85rem;
    color: #263a2e;
    font-size: clamp(2.25rem, 5vw, 4.1rem);
    font-weight: 800;
    letter-spacing: -.065em;
    line-height: 1.04;
}
.hero-copy > p { max-width: 460px; color: #58665b; font-size: clamp(1rem, 1.5vw, 1.15rem); line-height: 1.65; }
.hero-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.55rem; }
.hero-primary, .hero-secondary {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .8rem;
    border-radius: 14px;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.hero-primary { padding: .8rem 1.2rem; color: #fff; background: #315544; box-shadow: 0 9px 22px rgba(49, 85, 68, .22); }
.hero-primary:hover { transform: translateY(-2px); background: #264936; box-shadow: 0 13px 26px rgba(49, 85, 68, .28); }
.hero-primary span { font-size: 1.25rem; line-height: 1; }
.hero-secondary { padding: .75rem .25rem; color: #315544; }
.hero-secondary:hover { color: #a85f40; }
.hero-proof { margin-top: 1.35rem; color: #697468; font-size: .82rem; font-weight: 700; }
.hero-proof span { margin-right: .3rem; color: #c77952; }

.benefits {
    max-width: 1240px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0 auto clamp(3rem, 6vw, 5rem);
    padding: 1.1rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 254, 250, .82);
    box-shadow: var(--shadow-sm);
}
.benefit { display: flex; align-items: center; gap: .85rem; padding: .35rem 1.1rem; }
.benefit + .benefit { border-left: 1px solid var(--line); }
.benefit-icon { width: 42px; height: 42px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 14px; color: #315544; background: #edf1e9; font-size: 1.25rem; }
.benefit b, .benefit small { display: block; }
.benefit b { font-size: .9rem; font-weight: 800; }
.benefit small { margin-top: .16rem; color: var(--muted); font-size: .75rem; line-height: 1.45; }

.collections, .catalog-section { max-width: 1240px; margin: 0 auto; scroll-margin-top: 150px; }
.collections { margin-bottom: clamp(3rem, 6vw, 5rem); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.section-heading h2 { margin-top: .25rem; font-size: clamp(1.7rem, 3vw, 2.35rem); font-weight: 800; letter-spacing: -.055em; line-height: 1.12; }
.text-link { display: inline-flex; align-items: center; gap: .55rem; padding: .5rem 0; color: #315544; font-size: .9rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.text-link:hover { color: #a85f40; }
.collection-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.collection-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    aspect-ratio: 1.12 / 1;
    min-width: 0;
    padding: 0;
    border: 1px solid rgba(48, 56, 42, .08);
    border-radius: 20px;
    background: #e7dfd1;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .22s ease, box-shadow .22s ease;
}
.collection-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.collection-card > img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.collection-card:hover > img { transform: scale(1.045); }
.collection-shade { position: absolute; z-index: -1; inset: 20% 0 0; background: linear-gradient(180deg, transparent 0%, rgba(25, 34, 27, .76) 100%); }
.collection-copy { position: absolute; right: 1rem; bottom: 1rem; left: 1rem; display: flex; flex-direction: column; align-items: flex-start; color: #fff; }
.collection-copy small { margin-bottom: .22rem; color: rgba(255,255,255,.82); font-size: .72rem; font-weight: 700; }
.collection-copy b { max-width: calc(100% - 42px); font-size: clamp(.98rem, 1.4vw, 1.2rem); font-weight: 800; line-height: 1.2; }
.collection-arrow { position: absolute; right: 0; bottom: 0; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.38); border-radius: 50%; color: #fff; background: rgba(255,255,255,.14); font-size: 1rem; }
.catalog-heading { margin-bottom: .9rem; }
.catalog-bar { align-items: flex-start; margin-bottom: 1.2rem; }
.filters-extra { background: #f0eee5; }
.products { max-width: none; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem; }
.product { border-color: #e9e2d6; border-radius: 20px; background: #fffefa; box-shadow: 0 3px 14px rgba(56, 48, 35, .045); }
.product:hover { box-shadow: 0 16px 34px rgba(56, 48, 35, .13); border-color: #d7ddcf; }
.product-image { aspect-ratio: 1 / 1; border-bottom: 0; background: #f7f4ed; }
.product-image img { mix-blend-mode: multiply; }
.product-info { gap: .5rem; padding: .85rem .95rem .95rem; }
.product h3 { min-height: 2.45em; font-size: .94rem; line-height: 1.38; }
.product .category { color: #496b50; background: #edf1e9; font-size: .66rem; letter-spacing: .04em; }
.product .price { color: #cb11ab; font-size: 1.22rem; }
.product .price.price-regular { font-size: 1.35rem; }
.product button { margin: .15rem 0 0; border-radius: 12px; background: #315544; box-shadow: 0 6px 16px rgba(49, 85, 68, .18); }
.product button:hover { background: #264936; box-shadow: 0 10px 20px rgba(49, 85, 68, .24); }
.filter-chip.active { background: #315544; box-shadow: 0 6px 16px rgba(49, 85, 68, .18); }
.sort-select { border-color: #d7ddcf; }
.results-count { padding: .55rem 0; }
.product .badge-new { border-radius: 999px; color: #754329; background: #f5dfc9; }
.product .fav-btn { background: rgba(255,254,250,.94); }
.product .stock { color: #4e7852; }
.product .stock.stock-out { color: #9a5744; }

@media (max-width: 900px) {
    .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .collection-card { aspect-ratio: 1.45 / 1; }
    .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .benefit { padding-inline: .55rem; }
}

@media (max-width: 620px) {
    .header-main { flex-wrap: wrap; gap: .6rem .75rem; padding: .7rem .85rem; }
    .header-main .brand { order: 1; max-width: calc(100% - 145px); }
    .header-main .header-actions { order: 2; gap: .4rem; margin-left: auto; }
    .header-main .header-search { order: 3; flex: 1 1 100%; max-width: none; margin: 0; }
    .header-main .site-logo { max-width: min(42vw, 190px); }
    .header-main .cart-text, .header-main .fav-text { display: none; }
    .header-main .cart-btn, .header-main .fav-btn-header { padding: .5rem .65rem; }
    main { padding: .75rem .85rem 2rem; }
    .hero { min-height: 480px; margin-bottom: 1rem; border-radius: 22px; background-position: 66% center; }
    .hero::before { background: linear-gradient(90deg, rgba(251,248,242,.98) 0%, rgba(251,248,242,.92) 52%, rgba(251,248,242,.52) 100%); }
    .hero-copy { padding: 2.1rem 1.3rem; }
    .hero h2 { max-width: 440px; font-size: clamp(2.15rem, 10vw, 3.15rem); }
    .hero-copy > p { max-width: 360px; font-size: .97rem; }
    .hero-actions { align-items: flex-start; gap: .45rem .9rem; }
    .hero-primary { min-height: 48px; padding-inline: 1rem; }
    .hero-secondary { min-height: 44px; }
    .hero-proof { max-width: 260px; font-size: .75rem; }
    .benefits { grid-template-columns: 1fr; gap: .4rem; margin-bottom: 2.8rem; padding: .8rem; border-radius: 17px; }
    .benefit { padding: .45rem .3rem; }
    .benefit + .benefit { border-top: 1px solid var(--line); border-left: 0; }
    .benefit-icon { width: 38px; height: 38px; }
    .collections { margin-bottom: 2.8rem; }
    .section-heading { align-items: end; margin-bottom: 1rem; }
    .section-heading h2 { font-size: 1.7rem; }
    .text-link { font-size: .78rem; }
    .collection-grid { gap: .65rem; }
    .collection-card { aspect-ratio: .92 / 1; border-radius: 15px; }
    .collection-copy { right: .7rem; bottom: .7rem; left: .7rem; }
    .collection-copy small { font-size: .62rem; }
    .collection-copy b { font-size: .9rem; }
    .collection-arrow { width: 30px; height: 30px; }
    .catalog-section { scroll-margin-top: 120px; }
    .catalog-bar { gap: .55rem; }
    .filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .35rem; scrollbar-width: none; }
    .filters::-webkit-scrollbar { display: none; }
    .filters-extra { width: 100%; justify-content: space-between; }
    .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
    .product { border-radius: 15px; }
    .product-info { gap: .38rem; padding: .65rem; }
    .product h3 { min-height: 2.55em; font-size: .82rem; }
    .product .price { font-size: 1.05rem; }
    .product .price.price-regular { font-size: 1.2rem; }
    .product button { padding: .63rem .35rem; font-size: .82rem; }
    .product .category { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
    .collection-card, .collection-card > img, .hero-primary { transition: none; }
}
@media (max-width: 560px) {
    .docs th { white-space: normal; }
}


/* Out-of-stock card: dimmed */
.product.out-of-stock { background: #f7f8fa; }
.product.out-of-stock .product-image img { filter: grayscale(1); opacity: .55; }
.product.out-of-stock h3,
.product.out-of-stock .category,
.product.out-of-stock .article,
.product.out-of-stock .price { opacity: .55; }
.product.out-of-stock:hover .product-image img { transform: none; }

/* Waitlist button */
.product button.waitlist-btn,
.pv-add.pv-waitlist {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    box-shadow: none;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    box-shadow: 0 8px 18px rgba(245, 158, 11, .3);
}
.product button.waitlist-btn:hover,
.pv-add.pv-waitlist:hover { box-shadow: none; filter: brightness(1.05); }
.wl-note { font-size: .95rem; color: var(--muted); margin: .5rem 0 1rem; }
.wl-product { font-size: 1rem; font-weight: 700; margin: .5rem 0 1rem; }

/* ---------- Admin workspace refresh ---------- */
.admin-page {
    --admin-ink: #20352b;
    --admin-muted: #738076;
    --admin-line: #e5ebe5;
    --admin-surface: #ffffff;
    --admin-wash: #f4f7f3;
    background: #f3f6f2;
    background-image: radial-gradient(900px 420px at 88% -16%, rgba(127, 157, 123, .13), transparent 65%);
    color: var(--admin-ink);
}
.admin-page .admin-panel {
    padding: 1.2rem clamp(1rem, 3.3vw, 3rem) 3.5rem;
    background: transparent;
    box-shadow: none;
}
.admin-page .admin-panel > .admin-header {
    position: relative;
    align-items: center;
    margin-bottom: 1rem;
    padding: .25rem 0 1.05rem;
    border-bottom: 1px solid var(--admin-line);
}
.admin-page .admin-header h2 { color: var(--admin-ink); font-size: 1.15rem; letter-spacing: -.035em; }
.admin-page .admin-header h2::before {
    content: "NL";
    display: inline-grid;
    width: 34px;
    height: 34px;
    margin-right: .65rem;
    place-items: center;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(145deg, #315544, #6a8b70);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .02em;
    vertical-align: middle;
}
.admin-page .admin-header-actions { gap: .55rem; }
.admin-page .admin-who { padding: .45rem .75rem; border: 1px solid var(--admin-line); border-radius: 999px; color: #496550; background: #fff; }
.admin-page .close-admin {
    padding: .5rem .85rem;
    border: 1px solid var(--admin-line);
    border-radius: 11px;
    color: #46574a;
    background: #fff;
    font-size: .82rem;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.admin-page .close-admin:hover { border-color: #cbd9cb; color: var(--admin-ink); background: #f0f5ef; transform: none; }
.admin-page #admin-logout { color: #9e5145; background: #fff8f5; }
.admin-page #admin-logout:hover { border-color: #efd2c9; background: #fff0ea; }
.admin-page .admin-sync { max-width: 1280px; margin: 0 auto .85rem; border: 1px solid var(--admin-line); background: #fff; }
.admin-page .admin-tabs {
    position: sticky;
    top: 0;
    z-index: 30;
    gap: .3rem;
    margin-bottom: 1.45rem;
    padding: .4rem;
    overflow-x: auto;
    border: 1px solid var(--admin-line);
    border-radius: 15px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 6px 20px rgba(38, 53, 45, .055);
    backdrop-filter: blur(14px);
    scrollbar-width: thin;
}
.admin-page .admin-tab {
    flex: 0 0 auto;
    min-height: 40px;
    padding: .55rem .95rem;
    border-radius: 10px;
    color: #67756b;
    font-size: .84rem;
    white-space: nowrap;
}
.admin-page .admin-tab:hover { color: var(--admin-ink); background: #f6f8f5; }
.admin-page .admin-tab.active { color: #fff; background: #315544; box-shadow: 0 4px 12px rgba(49,85,68,.18); }
.admin-page .admin-tab.has-new-orders { color: #b74e40; }
.admin-page .admin-tab.active.has-new-orders { color: #fff; }
.admin-page .admin-content { color: var(--admin-ink); }
.admin-page .tab-panel { animation: adminRise .24s ease both; }
@keyframes adminRise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.admin-page #tab-dashboard { display: none; }
.admin-page #tab-dashboard.active { display: grid; gap: 1.25rem; }
.admin-page .dash-overview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: clamp(1.25rem, 2.5vw, 2rem);
    border: 1px solid #dfe8dd;
    border-radius: 22px;
    background: linear-gradient(112deg, #fff 0%, #fbfcf9 56%, #eef4eb 100%);
    box-shadow: 0 8px 28px rgba(35, 57, 42, .05);
}
.admin-page .dash-kicker { display: block; margin-bottom: .34rem; color: #68816d; font-size: .67rem; font-weight: 800; letter-spacing: .13em; }
.admin-page .dash-overview h2 { color: var(--admin-ink); font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 800; letter-spacing: -.055em; line-height: 1.15; }
.admin-page .dash-overview p { margin-top: .45rem; color: var(--admin-muted); font-size: .9rem; }
.admin-page .dash-live { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .4rem .55rem; max-width: 255px; color: #5f7163; font-size: .75rem; line-height: 1.45; }
.admin-page .dash-live-dot { grid-row: span 2; width: 9px; height: 9px; border-radius: 50%; background: #6eaa72; box-shadow: 0 0 0 4px rgba(110,170,114,.13); }
.admin-page .dash-live time { grid-column: 2; color: #8b968d; font-size: .72rem; }
.admin-page .dash-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .8rem; margin: 0; }
.admin-page .dash-card {
    position: relative;
    min-height: 132px;
    padding: 1rem 1.05rem;
    overflow: hidden;
    border: 1px solid var(--admin-line);
    border-radius: 17px;
    background: var(--admin-surface);
    box-shadow: 0 4px 15px rgba(38, 53, 45, .035);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.admin-page .dash-card:hover { transform: translateY(-2px); border-color: #cbd9cb; box-shadow: 0 10px 24px rgba(38, 53, 45, .08); }
.admin-page .dash-card-icon { display: grid; width: 33px; height: 33px; margin-bottom: .95rem; place-items: center; border-radius: 11px; color: #41684d; background: #edf4eb; font-size: 1rem; font-weight: 800; }
.admin-page .dash-card:nth-child(3n + 2) .dash-card-icon { color: #8a6546; background: #f7f0e7; }
.admin-page .dash-card:nth-child(3n) .dash-card-icon { color: #65729a; background: #eef0f8; }
.admin-page .dash-num { color: var(--admin-ink); font-size: clamp(1.4rem, 2vw, 1.9rem); letter-spacing: -.05em; line-height: 1.05; }
.admin-page #dash-revenue { font-size: clamp(1.18rem, 1.7vw, 1.6rem); }
.admin-page .dash-label { margin-top: .36rem; color: var(--admin-muted); font-size: .73rem; font-weight: 700; }
.admin-page .dash-section { min-width: 0; margin: 0; padding: 1.1rem; border: 1px solid var(--admin-line); border-radius: 18px; background: #fff; box-shadow: 0 5px 18px rgba(38, 53, 45, .035); }
.admin-page .dash-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.admin-page .dash-section-heading .dash-kicker { margin-bottom: .14rem; }
.admin-page .dash-section h3 { margin: 0; color: var(--admin-ink); font-size: 1rem; letter-spacing: -.025em; }
.admin-page .dash-period { padding: .38rem .62rem; border: 1px solid var(--admin-line); border-radius: 999px; color: #738076; background: #fbfcfa; font-size: .68rem; font-weight: 700; white-space: nowrap; }
.admin-page .charts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.admin-page .chart-card { min-width: 0; padding: 1rem; border-color: #edf0eb; border-radius: 14px; background: #fafbf9; }
.admin-page .chart-card-status { grid-column: 1 / -1; }
.admin-page .chart-title { color: #64736a; font-size: .72rem; letter-spacing: .07em; }
.admin-page .chart-bars { height: 132px; gap: .45rem; }
.admin-page .chart-bar { max-width: 30px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #88a783, #45694e); }
.admin-page #chart-revenue .chart-bar { background: linear-gradient(180deg, #d9ad75, #a67643); }
.admin-page .chart-col-label { color: #88948a; }
.admin-page #chart-statuses { min-height: 96px; justify-content: flex-start; }
.admin-page .donut { box-shadow: inset 0 0 0 11px #fafbf9; }
.admin-page .donut-legend-name { color: #5b6b60; }
.admin-page .dash-insights-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1rem; }
.admin-page .dash-recent-orders { grid-column: 1 / -1; }
.admin-page .dash-list { gap: .45rem; }
.admin-page .dash-row { min-width: 0; padding: .72rem .8rem; border-color: #edf0eb; border-radius: 12px; background: #fff; box-shadow: none; }
.admin-page .dash-row:hover { border-color: #d5e0d4; background: #fcfdfb; }
.admin-page .dash-row-title { color: #34463a; font-size: .83rem; }
.admin-page .dash-row-sub { color: #89948b; font-size: .72rem; }
.admin-page .dash-row-val { color: #46684d; font-size: .8rem; }
.admin-page .dash-badge { margin-left: .4rem; padding: .17rem .5rem; border-radius: 999px; color: #fff; font-size: .64rem; font-weight: 800; vertical-align: middle; }
.admin-page .dash-empty { padding: 1rem; border-color: #e7ece6; color: #89948b; background: #fafbf9; }
.admin-page .dash-analytics-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-bottom: .8rem; }
.admin-page .dash-analytics-stat { padding: .85rem 1rem; border: 1px solid #edf0eb; border-radius: 14px; background: #fafbf9; }
.admin-page .dash-analytics-num { display: block; color: var(--admin-ink); font-size: clamp(1.35rem, 2.2vw, 2rem); font-weight: 800; letter-spacing: -.05em; line-height: 1.05; }
.admin-page .dash-analytics-stat:first-child .dash-analytics-num { color: #41684d; }
.admin-page .dash-analytics-stat:last-child .dash-analytics-num { color: #8a6546; }
.admin-page .dash-analytics-label { display: block; margin-top: .3rem; color: var(--admin-muted); font-size: .73rem; font-weight: 700; }
.admin-page .admin-filter,
.admin-page .admin-toolbar,
.admin-page .list-item,
.admin-page .excel-tools { border-color: var(--admin-line); border-radius: 14px; }
.admin-page .list-item { background: #fff; box-shadow: 0 3px 12px rgba(38,53,45,.035); }
.admin-page .admin-toolbar { background: #fff; }

@media (min-width: 1500px) {
    .admin-page .admin-panel > .admin-header,
    .admin-page .admin-panel > .admin-sync,
    .admin-page .admin-panel > .admin-tabs,
    .admin-page .admin-panel > .admin-content { max-width: 1440px; }
}
@media (max-width: 1100px) {
    .admin-page .dash-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .admin-page .admin-panel { padding: .8rem .75rem 2rem; }
    .admin-page .admin-header { align-items: flex-start; }
    .admin-page .admin-header h2 { font-size: 1rem; }
    .admin-page .admin-who { display: none; }
    .admin-page .admin-tabs { top: 0; margin-bottom: 1rem; }
    .admin-page .dash-overview { align-items: flex-start; flex-direction: column; gap: 1rem; padding: 1.15rem; border-radius: 17px; }
    .admin-page .dash-live { max-width: none; }
    .admin-page .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    .admin-page .dash-card { min-height: 118px; padding: .8rem; }
    .admin-page .dash-card-icon { width: 29px; height: 29px; margin-bottom: .75rem; }
    .admin-page .dash-insights-grid { grid-template-columns: 1fr; }
    .admin-page .dash-recent-orders { grid-column: auto; }
    .admin-page .dash-analytics-stats { grid-template-columns: 1fr; }
    .admin-page .charts-grid { grid-template-columns: 1fr; }
    .admin-page .chart-card-status { grid-column: auto; }
    .admin-page .dash-section { padding: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
    .admin-page .tab-panel { animation: none; }
    .admin-page .dash-card { transition: none; }
}

/* ---------- Админка: меню слева ---------- */
.admin-page .admin-panel {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    align-items: start;
    padding: 0;
}
.admin-side {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: 1.1rem .85rem 1rem;
    background: #1f3a2e;
    background-image: linear-gradient(180deg, #24443a 0%, #1b3328 100%);
    color: #dfe9e1;
}
.admin-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .35rem .55rem 1.2rem;
    margin-bottom: .6rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: inherit;
    text-decoration: none;
}
.admin-brand-mark {
    display: grid;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, #8fb98a, #4e7a5b);
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .03em;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
}
.admin-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.admin-brand-text b { color: #fff; font-size: 1rem; font-weight: 800; letter-spacing: -.02em; }
.admin-brand-text small { color: #9fb7a6; font-size: .72rem; font-weight: 600; }

.admin-page .admin-tabs {
    position: static;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: .2rem;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    scrollbar-width: none;
}
.admin-page .admin-tab {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .7rem;
    min-height: 42px;
    padding: .55rem .75rem;
    border-radius: 11px;
    color: #b8cbbd;
    font-size: .88rem;
    font-weight: 700;
    text-align: left;
    transition: background .18s ease, color .18s ease;
}
.admin-page .admin-tab[hidden] { display: none; }
.admin-tab-ico {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .85;
}
.admin-tab-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.admin-page .admin-tab:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.admin-page .admin-tab.active {
    color: #1f3a2e;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
.admin-page .admin-tab.active .admin-tab-ico { opacity: 1; color: #3f7353; }
.admin-page .admin-tab.has-new-orders { color: #ffb4a6; }
.admin-page .admin-tab.active.has-new-orders { color: #1f3a2e; }
.admin-page .admin-tab-badge { margin-left: auto; background: #e5533d; }

.admin-side-foot {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-top: .8rem;
    padding: .9rem .4rem 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.admin-page .admin-side-foot .admin-who {
    padding: 0 .2rem;
    border: 0;
    background: none;
    color: #dfe9e1;
    font-size: .8rem;
}
.admin-page .admin-side-foot .admin-who:empty { display: none; }
.admin-side-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.admin-page .admin-side-foot .close-admin {
    justify-content: center;
    padding: .5rem .6rem;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    color: #dfe9e1;
    background: rgba(255, 255, 255, .06);
    font-size: .8rem;
}
.admin-page .admin-side-foot .close-admin:hover { color: #fff; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .2); }
.admin-page .admin-side-foot #admin-logout { color: #ffc9bd; background: rgba(255, 255, 255, .06); }
.admin-page .admin-side-foot #admin-logout:hover { color: #fff; background: rgba(229, 83, 61, .35); border-color: rgba(229, 83, 61, .5); }

.admin-main {
    min-width: 0;
    padding: 1.4rem clamp(1rem, 3vw, 2.6rem) 3.5rem;
}
.admin-page .admin-main > .admin-header,
.admin-page .admin-main > .admin-sync,
.admin-page .admin-main > .admin-content {
    width: 100%;
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
}
.admin-page .admin-main > .admin-header {
    display: flex;
    align-items: flex-end;
    margin-bottom: 1.3rem;
    padding: 0 0 1rem;
    border-bottom: 1px solid var(--admin-line);
}
.admin-page .admin-header h2 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); font-weight: 800; letter-spacing: -.04em; }
.admin-page .admin-header h2::before { content: none; }
.admin-header-kicker {
    display: block;
    margin-bottom: .2rem;
    color: #7c8d80;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.admin-page .admin-card,
.admin-page .admin-filter,
.admin-page .admin-toolbar,
.admin-page .list-item,
.admin-page .excel-tools { border-radius: 16px; }
.admin-page .admin-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.admin-page .admin-content select:focus,
.admin-page .admin-content textarea:focus {
    border-color: #6f9a78;
    box-shadow: 0 0 0 3px rgba(111, 154, 120, .18);
    outline: none;
}

@media (max-width: 900px) {
    .admin-page .admin-panel { display: block; }
    .admin-side {
        position: sticky;
        z-index: 40;
        height: auto;
        padding: .6rem .7rem;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: .5rem;
    }
    .admin-brand { padding: 0; margin: 0; border: 0; }
    .admin-brand-mark { width: 32px; height: 32px; border-radius: 10px; }
    .admin-brand-text small { display: none; }
    .admin-side-foot { order: 2; flex-direction: row; align-items: center; margin: 0 0 0 auto; padding: 0; border: 0; }
    .admin-page .admin-side-foot .admin-who { display: none; }
    .admin-side-actions { display: flex; }
    .admin-page .admin-tabs {
        order: 3;
        flex: 1 0 100%;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: .1rem;
    }
    .admin-page .admin-tab { min-height: 38px; padding: .45rem .7rem; gap: .45rem; white-space: nowrap; }
    .admin-tab-label { overflow: visible; }
    .admin-main { padding: 1rem .8rem 2.5rem; }
    .admin-page .admin-main > .admin-header { margin-bottom: 1rem; padding-bottom: .7rem; }
}

/* ---------- Продажи: состав, срочность, липкая кнопка ---------- */
.product-spec {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.product .stock.stock-low,
.pv-stock .stock.stock-low { color: #b45309; }
.pv-spec-title {
    margin-bottom: .15rem;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}
@media (max-width: 620px) {
    .pv-actions {
        position: sticky;
        bottom: 0;
        z-index: 3;
        margin: .9rem -1.1rem -1.1rem;
        padding: .7rem 1.1rem calc(.7rem + env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        background: rgba(255, 254, 250, .96);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

/* ---------- Футер ---------- */
.site-footer {
    margin-top: clamp(2.5rem, 6vw, 4.5rem);
    border-top: 1px solid var(--line);
    background: rgba(255, 254, 250, .72);
    color: var(--muted);
}
.footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: clamp(1.8rem, 4vw, 2.8rem) clamp(1rem, 3vw, 2rem) 1.4rem;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1.3fr 1fr;
    gap: clamp(1.2rem, 3vw, 2.4rem);
}
.footer-col { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.footer-col[hidden] { display: none; }
.footer-head {
    margin-bottom: .2rem;
    color: var(--text);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.footer-brand { display: flex; align-items: center; gap: .6rem; }
.footer-brand img { width: auto; height: 30px; border-radius: 7px; }
.footer-brand b { color: var(--text); font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; }
.footer-tagline { font-size: .78rem; }
.footer-about-text { margin: .25rem 0 0; font-size: .82rem; line-height: 1.55; }
.footer-col span { font-size: .85rem; line-height: 1.5; }
.footer-col a { color: var(--muted); font-size: .85rem; text-decoration: none; }
.footer-col a:hover { color: #a85f40; }
.footer-col a.footer-link { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; }
.fl-ico {
    flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center; color: #fff;
}
.fl-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2;
    stroke-linecap: round; stroke-linejoin: round; }
.fl-tg .fl-ico { background: #229ed9; }
.fl-max .fl-ico { background: #6b4bff; }
.fl-help .fl-ico { background: #fff; color: #b4441c; border: 2px solid #b4441c; }
.footer-col a.fl-help { color: #b4441c; }
.footer-bottom {
    max-width: 1240px;
    margin: 0 auto;
    padding: .9rem clamp(1rem, 3vw, 2rem) 1.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1.5rem;
    border-top: 1px solid var(--line);
    font-size: .76rem;
}
@media (max-width: 900px) {
    .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .footer-inner { grid-template-columns: 1fr; }
}

/* ---------- Страницы «Блог» и «Калькуляторы» ---------- */
.page-nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.page-nav--header { border-bottom: 0; background: transparent; }
.page-nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: .45rem 1.4rem .8rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.page-nav-link {
    display: inline-flex;
    align-items: center;
    padding: .35rem .85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--accent);
    font-size: .82rem;
    font-weight: 800;
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease;
}
.page-nav-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.page-nav-link[hidden], .page-nav[hidden] { display: none !important; }

.inner-page { background: var(--bg); }
.inner-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.inner-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: .85rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.inner-brand { display: flex; flex-direction: column; color: var(--text); text-decoration: none; }
.inner-brand b { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.inner-brand span { color: var(--muted); font-size: .7rem; font-weight: 600; }

.page-main { max-width: 1120px; margin: 0 auto; padding: 2.2rem 1.4rem 3rem; }
.page-heading { margin-bottom: 1.7rem; }
.page-heading h2 { margin: .15rem 0 .35rem; font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.1; letter-spacing: -.03em; }
.page-heading p { margin: 0; max-width: 640px; color: var(--muted); font-size: .98rem; line-height: 1.6; }

.page-empty {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .45rem;
    padding: 2rem;
    border: 1px dashed var(--line);
    border-radius: 18px;
    background: var(--surface);
    color: var(--muted);
}
.page-empty b { color: var(--text); font-size: 1.1rem; }
.page-empty .text-link { margin-top: .5rem; }

/* Modern blog: hero + list of articles */
.blog-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    padding: clamp(1.5rem, 4vw, 2.7rem);
    border: 1px solid var(--line);
    border-radius: 26px;
    background:
        radial-gradient(520px 240px at 90% -20%, rgba(82, 117, 96, .17), transparent 70%),
        linear-gradient(135deg, #fffefa 0%, #f7f1e6 58%, #edf2ec 100%);
    box-shadow: var(--shadow-sm);
}
.blog-hero::after {
    content: '';
    position: absolute;
    right: -46px;
    bottom: -82px;
    width: 230px;
    height: 230px;
    border: 1px solid rgba(49, 85, 68, .16);
    border-radius: 50%;
    pointer-events: none;
}
.blog-hero-copy { position: relative; z-index: 1; }
.blog-hero .eyebrow { margin-bottom: .55rem; }
.blog-hero h2 { margin: 0 0 .5rem; font-size: clamp(2.3rem, 5vw, 3.5rem); line-height: 1; letter-spacing: -.05em; }
.blog-hero p { max-width: 560px; }
.blog-count {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    padding: .55rem .9rem;
    border: 1px solid rgba(49, 85, 68, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    color: var(--accent);
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.blog-list { display: flex; flex-direction: column; gap: .9rem; }
.blog-card {
    display: grid;
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(56, 48, 35, .03), 0 10px 30px rgba(56, 48, 35, .04);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.blog-card:hover { transform: translateY(-2px); border-color: rgba(49, 85, 68, .34); box-shadow: var(--shadow-lg); }
.blog-card-media { position: relative; min-height: 190px; overflow: hidden; background: var(--bg); }
.blog-card-cover { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.blog-card:hover .blog-card-cover { transform: scale(1.045); }
.blog-card-cover--empty {
    display: grid;
    place-items: center;
    min-height: 100%;
    height: 100%;
    color: rgba(255, 255, 255, .9);
    font-size: 3.2rem;
    background:
        radial-gradient(220px 160px at 75% 15%, rgba(255, 255, 255, .16), transparent 70%),
        linear-gradient(135deg, #315544 0%, #527560 100%);
}
.blog-card-body {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-width: 0;
    padding: clamp(1rem, 2.2vw, 1.55rem) clamp(1.1rem, 2.6vw, 1.8rem);
}
.blog-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.blog-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .55; }
.blog-card-title {
    color: var(--text);
    font-size: clamp(1.1rem, 1.9vw, 1.42rem);
    font-weight: 800;
    line-height: 1.28;
    letter-spacing: -.02em;
}
.blog-excerpt {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.55;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.blog-card-foot { margin-top: auto; padding-top: .5rem; }
.blog-more { display: inline-flex; align-items: center; gap: .4rem; color: var(--accent); font-size: .82rem; font-weight: 800; }
.blog-more span { transition: transform .2s ease; }
.blog-card:hover .blog-more span { transform: translateX(4px); }

.blog-article { max-width: 820px; margin: 0 auto; }
.blog-back { display: inline-flex; margin-bottom: .9rem; color: var(--accent); font-size: .85rem; font-weight: 800; text-decoration: none; }
.blog-back:hover { text-decoration: underline; }
.blog-article-card {
    padding: clamp(1.15rem, 3.5vw, 2.6rem);
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.blog-article-cover { width: 100%; max-height: 460px; object-fit: cover; border-radius: 18px; margin: 0 0 1.3rem; display: block; }
.blog-article-meta { margin-bottom: .65rem; }
.blog-article h1 { margin: .2rem 0 .65rem; font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.12; letter-spacing: -.035em; }
.blog-article-lead { max-width: 65ch; margin: 0 0 1rem; color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.blog-empty {
    align-items: center;
    justify-content: center;
    min-height: 220px;
    text-align: center;
    background: linear-gradient(135deg, #fffefa 0%, #f7f1e6 100%);
}
.blog-empty-icon { color: var(--accent); font-size: 2.6rem; line-height: 1; opacity: .48; }
.blog-empty .text-link { margin-top: 0; }

@media (max-width: 720px) {
    .blog-hero { align-items: flex-start; flex-direction: column; gap: 1rem; }
    .blog-card { grid-template-columns: 1fr; }
    .blog-card-media { min-height: 0; aspect-ratio: 16 / 9; }
    .blog-card-cover, .blog-card-cover--empty { position: absolute; inset: 0; width: 100%; height: 100%; }
    .blog-card-body { padding: 1rem 1.1rem 1.2rem; }
    .blog-excerpt { -webkit-line-clamp: 3; }
    .blog-article-card { padding: 1rem; border-radius: 20px; }
    .blog-article-cover { border-radius: 14px; }
    .blog-file { padding: .65rem .7rem; }
    .blog-file-icon { width: 38px; height: 38px; }
}
.blog-text { margin-top: 1.3rem; color: var(--text); font-size: 1rem; line-height: 1.78; }
.blog-text::after { content: ''; display: table; clear: both; }
.blog-text p, .blog-text div { margin: 0 0 .95em; }
.blog-text p:empty, .blog-text div:empty { display: none; }
.blog-text p:last-child { margin-bottom: 0; }
.blog-text h2 { margin: 1.45em 0 .6em; font-size: clamp(1.35rem, 2.4vw, 1.7rem); line-height: 1.22; letter-spacing: -.02em; }
.blog-text h3 { margin: 1.25em 0 .5em; font-size: clamp(1.12rem, 1.8vw, 1.32rem); line-height: 1.3; }
.blog-text ul, .blog-text ol { margin: 0 0 1em 1.35em; padding: 0; }
.blog-text li { margin: .22em 0; }
.blog-text blockquote {
    margin: 1.1em 0;
    padding: .7em 1em;
    border-left: 3px solid var(--accent);
    border-radius: 0 12px 12px 0;
    background: var(--accent-soft);
}
.blog-text a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.blog-text strong, .blog-text b { font-weight: 800; }

/* PDF attachments in blog articles */
.blog-files {
    margin-top: 1.7rem;
    padding-top: 1.35rem;
    border-top: 1px solid var(--line);
}
.blog-files-kicker {
    display: block;
    margin-bottom: .2rem;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.blog-files h2 {
    margin: 0 0 .8rem;
    color: var(--text);
    font-size: clamp(1.08rem, 1.9vw, 1.3rem);
    line-height: 1.25;
    letter-spacing: -.015em;
}
.blog-files-list { display: flex; flex-direction: column; gap: .55rem; }
.blog-file {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .72rem .8rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfaf7;
    color: inherit;
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.blog-file:hover {
    border-color: rgba(49, 85, 68, .34);
    background: #f7faf6;
    transform: translateY(-1px);
}
.blog-file-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: #fbecea;
    color: #a84338;
    font-size: .64rem;
    font-weight: 900;
    letter-spacing: .04em;
}
.blog-file-copy { display: flex; flex-direction: column; gap: .14rem; flex: 1; min-width: 0; }
.blog-file-name {
    overflow: hidden;
    color: var(--text);
    font-size: .9rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.blog-file-meta { color: var(--muted); font-size: .75rem; }
.blog-file-arrow { flex-shrink: 0; color: var(--accent); font-size: 1.1rem; font-weight: 800; }

/* Rich text: images in articles and in the admin editor */
.rte-img { display: block; max-width: 100%; height: auto; margin: 1rem 0; border-radius: 14px; }
.rte-img--center { margin-left: auto; margin-right: auto; }
.rte-img--left { float: left; margin: .25rem 1.2rem .9rem 0; }
.rte-img--right { float: right; margin: .25rem 0 .9rem 1.2rem; }
.rte-img--small { width: 30%; min-width: 140px; }
.rte-img--medium { width: 50%; min-width: 210px; }
.rte-img--large { width: 75%; }
.rte-img--full { width: 100%; }
@media (max-width: 640px) {
    .rte-img--left, .rte-img--right { float: none; margin: 1rem auto; }
    .rte-img--small, .rte-img--medium, .rte-img--large { width: 100%; min-width: 0; }
}

.calc-grid { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 24px 0; }
#calc-list .vine-calc * { box-sizing: content-box; }
#calc-list .vine-calc {
    box-sizing: border-box;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 20px 20px;
    border-radius: 26px;
    background: linear-gradient(180deg, #e8f1f8, #d3e3ef);
    box-shadow: 0 8px 28px rgba(44, 71, 84, .14);
    color: #2c4753;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    line-height: normal;
}
#calc-list .vine-calc h2 {
    margin: 0 0 8px;
    text-align: center;
    font-size: clamp(22px, 6vw, 30px);
    font-weight: 700;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: .5px;
}
#calc-list .vine-calc h2 span {
    display: block;
    font-size: .62em;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}
#calc-list .vine-calc h2 strong { display: block; font-size: .95em; }
#calc-list .vine-calc h3 {
    margin: 26px 0 4px;
    font-size: clamp(17px, 4.6vw, 21px);
    font-style: italic;
    font-weight: 700;
    text-decoration: underline 2px;
    text-underline-offset: 5px;
}
#calc-list .vine-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 26px 0 0;
    font-size: 15px;
    line-height: 1.3;
}
#calc-list .vine-row span { flex: 1; }
#calc-list .vine-row[data-op]::before {
    content: attr(data-op);
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    color: #d1362a;
    font-size: 19px;
    font-weight: 700;
    line-height: 1;
}
#calc-list .vine-row input {
    flex: none;
    width: 96px;
    padding: 10px 8px;
    border: 1px solid #b9cfdd;
    border-radius: 12px;
    background: #fff;
    color: inherit;
    font: inherit;
    font-size: 16px;
    text-align: center;
}
#calc-list .vine-row input:focus {
    outline: 2px solid #7ba7bf;
    outline-offset: 1px;
}
#calc-list .vine-row--static {
    margin-top: 22px;
    color: #6d8795;
    font-size: 14px;
}
#calc-list .vine-out {
    margin: 22px 0 0;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fff;
    text-align: center;
    font-size: 16px;
}
#calc-list .vine-out b { font-size: 22px; white-space: nowrap; }
#calc-list .vine-lead {
    margin: 8px 0 0;
    text-align: center;
    color: #6d8795;
    font-size: 14px;
    line-height: 1.35;
}

/* Админка: редактор калькулятора и обложка статьи */
.calc-sections-editor { margin: .3rem 0 1rem; padding: 1rem; border: 1px dashed var(--line); border-radius: 14px; background: #fbfaf6; }
.calc-sections-editor > .calc-fields-head { align-items: flex-start; margin-bottom: .8rem; }
.calc-sections-editor > .calc-fields-head small { display: block; margin-top: .18rem; color: var(--muted); font-size: .74rem; font-weight: 600; line-height: 1.4; }
#calc-sections { display: flex; flex-direction: column; gap: .9rem; }
.calc-section-editor { padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.calc-section-editor-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .75rem; }
.calc-section-editor-head b { color: var(--accent); font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; }
.calc-section-editor .calc-fields-editor { margin: .5rem 0 .9rem; }
.calc-section-fields { display: flex; flex-direction: column; gap: .5rem; }
.calc-fields-editor .calc-fields-head small { display: block; margin-top: .18rem; color: var(--muted); font-size: .7rem; font-weight: 600; line-height: 1.35; }
.cf-optional-wrap { display: flex; align-items: center; gap: .28rem; color: var(--muted); font-size: .66rem; font-weight: 700; white-space: nowrap; }
.cf-optional-wrap input { width: 14px; height: 14px; accent-color: var(--accent); }
.calc-fields-editor { margin: .3rem 0 1rem; padding: 1rem; border: 1px dashed var(--line); border-radius: 12px; background: #fbfaf6; }
.calc-fields-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; }
#calc-fields { display: flex; flex-direction: column; gap: .5rem; }
.calc-field-row { display: grid; grid-template-columns: 26px minmax(0, 1.4fr) 84px 96px 86px 34px; gap: .45rem; align-items: center; }
.calc-field-row input {
    width: 100%;
    padding: .48rem .55rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: .86rem;
}
.cf-key { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: .74rem; font-weight: 800; }
.cf-remove { width: 34px; height: 34px; padding: 0; font-size: 1rem; line-height: 1; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.blog-cover-thumb img { width: 160px; height: 100px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

@media (max-width: 700px) {
    .inner-header-inner { padding: .7rem 1rem; }
    .page-main { padding: 1.5rem 1rem 2.4rem; }
    .page-nav-inner { padding: .4rem 1rem .7rem; }
    .blog-grid { grid-template-columns: 1fr; }
    .form-row-2 { grid-template-columns: 1fr; }
    .calc-field-row { grid-template-columns: 22px minmax(0, 1fr) 64px 72px 70px 30px; gap: .25rem; }
    .cf-optional-wrap span { display: none; }
}

[data-page-link][hidden] { display: none !important; }

/* ---------- Админка: дашборд ---------- */
.admin-page #tab-dashboard { display: none; flex-direction: column; gap: 1rem; }
.admin-page #tab-dashboard.active { display: flex; }
.admin-page .dh-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.4rem 1.5rem; border-radius: 20px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #4c7a62 0%, #2c4d3d 55%, #213b2f 100%); box-shadow: 0 14px 34px rgba(33, 59, 47, .18); }
.admin-page .dh-date { display: block; margin-bottom: .3rem; color: rgba(255,255,255,.66); font-size: .78rem; font-weight: 700; text-transform: capitalize; }
.admin-page .dh-hello h2 { color: #fff; font-size: clamp(1.45rem, 2.6vw, 2.05rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.1; }
.admin-page .dh-hello p { margin-top: .4rem; color: rgba(255,255,255,.82); font-size: .95rem; }
.admin-page .dh-period { display: inline-flex; gap: .2rem; padding: .25rem; border-radius: 999px; background: rgba(255,255,255,.12); }
.admin-page .dh-period button { padding: .5rem .95rem; border: 0; border-radius: 999px; color: rgba(255,255,255,.8); background: transparent; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; transition: background .15s ease, color .15s ease; }
.admin-page .dh-period button:hover { color: #fff; background: rgba(255,255,255,.1); }
.admin-page .dh-period button.active { color: #213b2f; background: #fff; }

.admin-page .dh-todo { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .75rem; }
.admin-page .dh-todo-card, .admin-page .dh-todo-ok { display: flex; align-items: center; gap: .85rem; width: 100%; padding: .9rem 1rem; border: 1px solid var(--admin-line); border-left: 4px solid var(--tone, #6eaa72); border-radius: 14px; background: #fff; font: inherit; text-align: left; color: var(--admin-ink); }
.admin-page .dh-todo-card { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.admin-page .dh-todo-card:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(38, 53, 45, .08); }
.admin-page .dh-todo-card > b, .admin-page .dh-todo-ok > b { display: grid; flex-shrink: 0; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: var(--tone, #3f7a4a); background: color-mix(in srgb, var(--tone, #6eaa72) 13%, #fff); font-size: 1.2rem; font-weight: 800; }
.admin-page .dh-todo-card > span, .admin-page .dh-todo-ok > span { display: flex; flex: 1; flex-direction: column; gap: .12rem; min-width: 0; }
.admin-page .dh-todo-card strong, .admin-page .dh-todo-ok strong { font-size: .9rem; }
.admin-page .dh-todo-card small, .admin-page .dh-todo-ok small { color: var(--admin-muted); font-size: .74rem; }
.admin-page .dh-todo-card > i { color: #a3aea5; font-style: normal; font-weight: 800; }
.admin-page .dh-todo-card--blue { --tone: #3b82f6; }
.admin-page .dh-todo-card--teal { --tone: #0e9bc9; }
.admin-page .dh-todo-card--amber { --tone: #d48a1c; }
.admin-page .dh-todo-card--violet { --tone: #9b59d0; }

.admin-page .dh-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.admin-page .dh-kpi { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem; border: 1px solid var(--admin-line); border-radius: 16px; background: #fff; }
.admin-page .dh-kpi-label { color: var(--admin-muted); font-size: .76rem; font-weight: 700; }
.admin-page .dh-kpi-num { color: var(--admin-ink); font-size: clamp(1.35rem, 2.2vw, 1.85rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.1; white-space: nowrap; }
.admin-page .dh-kpi-delta { font-size: .74rem; font-weight: 700; }
.admin-page .dh-kpi-delta--up { color: #1f8a46; }
.admin-page .dh-kpi-delta--down { color: #c2412d; }
.admin-page .dh-kpi-delta--muted { color: #96a199; }

.admin-page .dh-row { display: grid; gap: 1rem; align-items: start; }
.admin-page .dh-row--main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.admin-page .dh-row--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-page .dh-card { min-width: 0; padding: 1.1rem 1.15rem; border: 1px solid var(--admin-line); border-radius: 18px; background: #fff; }
.admin-page .dh-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; margin-bottom: .9rem; }
.admin-page .dh-card-head h3 { margin: 0; color: var(--admin-ink); font-size: 1rem; font-weight: 800; letter-spacing: -.02em; }
.admin-page .dh-card-note { color: #96a199; font-size: .73rem; font-weight: 600; text-align: right; }
.admin-page .dh-link { padding: 0; border: 0; color: #3f7a4a; background: none; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.admin-page .dh-link:hover { text-decoration: underline; }
.admin-page .dh-sub-head { margin: 1.1rem 0 .55rem; color: var(--admin-muted); font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

.admin-page .dh-chart { position: relative; height: 230px; }
.admin-page .dh-bars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); align-items: end; gap: clamp(2px, .5vw, 8px); height: 100%; padding-top: .5rem; background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), #eef2ed calc(25% - 1px), #eef2ed 25%); background-size: 100% calc(100% - 1.4rem); background-repeat: no-repeat; }
.admin-page .dh-bar-col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }
.admin-page .dh-bar { width: 100%; max-width: 38px; margin: 0 auto; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #6fa07a, #315544); transition: filter .15s ease; }
.admin-page .dh-bar-col.is-empty .dh-bar { height: 3px !important; background: #e3e9e2; }
.admin-page .dh-bar-label { height: 1.4rem; padding-top: .35rem; overflow: hidden; color: #96a199; font-size: .66rem; font-weight: 600; text-align: center; white-space: nowrap; }
.admin-page .dh-bar-tip { position: absolute; bottom: calc(100% - 1.6rem); left: 50%; z-index: 2; display: none; flex-direction: column; gap: .1rem; padding: .45rem .6rem; border-radius: 9px; color: rgba(255,255,255,.75); background: #1f3a2e; font-size: .7rem; white-space: nowrap; transform: translateX(-50%); pointer-events: none; }
.admin-page .dh-bar-tip b { color: #fff; font-size: .85rem; }
.admin-page .dh-bar-col:hover .dh-bar { filter: brightness(1.15); }
.admin-page .dh-bar-col:hover .dh-bar-tip { display: flex; }
.admin-page .dh-bar-col:first-child .dh-bar-tip, .admin-page .dh-bar-col:nth-child(2) .dh-bar-tip { left: 0; transform: none; }
.admin-page .dh-bar-col:last-child .dh-bar-tip, .admin-page .dh-bar-col:nth-last-child(2) .dh-bar-tip { left: auto; right: 0; transform: none; }

.admin-page .dh-list { display: flex; flex-direction: column; gap: .4rem; }
.admin-page .dh-card .dash-row { padding: .65rem .75rem; border: 1px solid #edf0eb; border-radius: 12px; background: #fff; box-shadow: none; }
.admin-page .dh-card .dash-row-order:hover { border-color: #cbd9cb; background: #f8faf7; transform: none; box-shadow: none; }
.admin-page .dh-order-side { display: flex; flex-shrink: 0; flex-direction: column; align-items: flex-end; gap: .25rem; }
.admin-page .dh-pill { padding: .14rem .5rem; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); font-size: .66rem; font-weight: 800; white-space: nowrap; }
.admin-page .dh-rank { display: grid; flex-shrink: 0; width: 26px; height: 26px; place-items: center; border-radius: 8px; color: #41684d; background: #edf4eb; font-size: .75rem; font-weight: 800; }
.admin-page .dh-card .dash-row-main { flex: 1; }
.admin-page .dh-list--compact .dash-row { padding: .5rem .65rem; }

.admin-page .dh-card #chart-statuses { gap: 1.2rem; min-height: 0; }
.admin-page .dh-card .donut { width: 104px; height: 104px; box-shadow: none; -webkit-mask: radial-gradient(circle, transparent 54%, #000 55%); mask: radial-gradient(circle, transparent 54%, #000 55%); }
.admin-page .dh-split-bar { display: flex; height: 12px; overflow: hidden; border-radius: 999px; background: #eef2ed; }
.admin-page .dh-split-bar span:first-child { background: #315544; }
.admin-page .dh-split-bar span:last-child { background: #005bff; }
.admin-page .dh-split-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem .8rem; margin-top: .55rem; color: #5b6b60; font-size: .78rem; }
.admin-page .dh-split-legend b { margin-left: .25rem; color: var(--admin-ink); }
.admin-page .dh-dot { display: inline-block; width: 9px; height: 9px; margin-right: .35rem; border-radius: 50%; vertical-align: middle; }
.admin-page .dh-dot--pickup { background: #315544; }
.admin-page .dh-dot--ozon { background: #005bff; }

.admin-page .dh-seg { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .75rem; }
.admin-page .dh-seg button { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .7rem; border: 1px solid var(--admin-line); border-radius: 999px; color: #5b6b60; background: #fff; font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; }
.admin-page .dh-seg button:hover { border-color: #cbd9cb; }
.admin-page .dh-seg button.active { border-color: #315544; color: #fff; background: #315544; }
.admin-page .dh-seg i { font-style: normal; font-size: .68rem; opacity: .75; }
.admin-page .dh-seg i:empty { display: none; }
.admin-page .dh-pane { display: none; }
.admin-page .dh-pane.active { display: flex; flex-direction: column; gap: .4rem; }
.admin-page .dh-interest .dh-list, .admin-page #dash-article-views-list { max-height: 330px; overflow-y: auto; }

.admin-page .dh-mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .75rem; }
.admin-page .dh-mini-stats div { display: flex; flex-direction: column; gap: .2rem; padding: .8rem .9rem; border-radius: 14px; background: #f4f7f3; }
.admin-page .dh-mini-stats b { color: #315544; font-size: 1.5rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.admin-page .dh-mini-stats div:last-child b { color: #8a6546; }
.admin-page .dh-mini-stats span { color: var(--admin-muted); font-size: .72rem; font-weight: 700; }

.admin-page .dh-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; padding: .3rem .2rem; color: #8b968d; font-size: .75rem; }
.admin-page .dh-foot b { color: #5b6b60; }
.admin-page .dh-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #6eaa72; box-shadow: 0 0 0 4px rgba(110,170,114,.15); animation: dhPulse 2.4s ease-in-out infinite; }
@keyframes dhPulse { 50% { box-shadow: 0 0 0 7px rgba(110,170,114,0); } }

@media (max-width: 1200px) {
    .admin-page .dh-row--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-page .dh-row--three > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
    .admin-page .dh-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-page .dh-row--main, .admin-page .dh-row--three { grid-template-columns: 1fr; }
    .admin-page .dh-row--three > :last-child { grid-column: auto; }
}
@media (max-width: 560px) {
    .admin-page .dh-top { padding: 1.1rem; border-radius: 16px; }
    .admin-page .dh-period { width: 100%; }
    .admin-page .dh-period button { flex: 1; padding: .5rem .4rem; }
    .admin-page .dh-chart { height: 180px; }
    .admin-page .dh-kpi { padding: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
    .admin-page .dh-live-dot { animation: none; }
}
/* ---------- Админка: мастер-классы ---------- */
.admin-page .mc-pill { display: inline-block; margin-left: .35rem; padding: .12rem .5rem; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); font-size: .68rem; font-weight: 800; vertical-align: middle; white-space: nowrap; }
.admin-page .mc-note { margin-top: .3rem; color: #5b6b60; font-size: .8rem; white-space: pre-line; }
.admin-page .mc-warn { margin-top: .3rem; color: #c2412d; font-size: .76rem; font-weight: 700; }
/* ---------- Установка как приложение ---------- */
.footer-col button.footer-link { display: flex; align-items: center; gap: .6rem; padding: 0; border: 0; background: none; color: #315544; font: inherit; font-size: .85rem; font-weight: 700; text-align: left; cursor: pointer; }
.footer-col button.footer-link:hover { color: #a85f40; }
.footer-col button.footer-link[hidden] { display: none; }
.fl-app .fl-ico { background: #315544; }
.admin-install { display: flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem .6rem; border: 1px solid rgba(226, 179, 93, .45); border-radius: 10px; color: #f3d9a6; background: rgba(226, 179, 93, .12); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.admin-install:hover { color: #fff; background: rgba(226, 179, 93, .25); }
.admin-install[hidden] { display: none; }
.admin-install svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.install-hint { position: fixed; left: 50%; bottom: 16px; z-index: 1000; width: min(420px, calc(100% - 32px)); padding: 1.1rem 1.2rem; border-radius: 18px; color: #20352b; background: #fff; box-shadow: 0 18px 48px rgba(20, 40, 30, .28); font-size: 1rem; line-height: 1.5; transform: translateX(-50%); }
.install-hint[hidden] { display: none; }
.install-hint b { display: block; margin-bottom: .4rem; font-size: 1.1rem; }
.install-hint ol { margin: 0 0 .9rem; padding-left: 1.3rem; }
.install-hint-close { width: 100%; padding: .8rem; border: 0; border-radius: 12px; color: #fff; background: #315544; font: inherit; font-weight: 700; cursor: pointer; }
@media (max-width: 900px) {
    .admin-page .admin-side-foot .admin-install { padding: .45rem .6rem; font-size: 0; gap: 0; }
    .admin-page .admin-side-foot .admin-install svg { width: 18px; height: 18px; }
}