:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e6e9f2;
    --accent: #4f46e5;
    --accent-2: #7c3aed;
    --accent-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --accent-soft: rgba(79, 70, 229, .12);
    --green: #059669;
    --red: #e11d48;
    --radius: 18px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 16px rgba(15, 23, 42, .06);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, .16);
    --ring: 0 0 0 4px var(--accent-soft);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .85rem clamp(1rem, 4vw, 2.5rem);
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

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

header h1::before {
    content: '';
    width: 30px;
    height: 30px;
    border-radius: 9px;
    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: 32px;
    width: auto;
    max-width: min(46vw, 180px);
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

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

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

.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;
}

.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: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .25s ease, border-color .25s ease;
}

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

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

.product img {
    width: 100%;
    height: 195px;
    object-fit: cover;
    display: block;
    background: #eef1f7;
    transition: transform .45s ease;
}

.product:hover img { transform: scale(1.06); }

.product h3 {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 1rem 1.15rem .35rem;
}

.product .category {
    margin: 0 1.15rem;
    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;
}

.product .price {
    margin: .7rem 1.15rem .4rem;
    font-size: 1.22rem;
    font-weight: 800;
    color: var(--green);
    letter-spacing: -.02em;
}

.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; }

.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);
}

/* ---------- 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; }

.sort-select {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--line);
    background-color: var(--surface);
    background-image: 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='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 12px 12px;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    font-size: .88rem;
    padding: .5rem 2.1rem .5rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: border-color .2s ease, color .2s ease, box-shadow .2s ease;
}

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

.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-btn {
    border: 1.5px solid var(--line);
    background: var(--surface);
    color: var(--accent);
    font: inherit;
    font-weight: 700;
    font-size: .95rem;
    padding: .8rem 2rem;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 10px 22px rgba(79, 70, 229, .18);
}

.load-more-btn: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-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-qty { display: flex; align-items: center; gap: .55rem; margin-top: .5rem; }

.cart-item-qty button {
    width: 26px;
    height: 26px;
    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 {
    margin-top: auto;
    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-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; }

.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); }

.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; }

.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 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; }

.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-info { flex: 1; min-width: 0; }
.list-item-name { font-weight: 700; font-size: .95rem; }
.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; }

.btn-edit, .btn-delete, .btn-toggle {
    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-delete { background: #fff1f2; color: var(--red); }
.btn-edit:hover, .btn-delete:hover, .btn-toggle: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;
}

/* ---------- 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 {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 16px;
    background: #eef1f7;
    box-shadow: var(--shadow-sm);
    display: block;
}

.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-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: var(--green);
    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;
    justify-content: space-between;
    gap: .8rem;
    font-size: .88rem;
    padding: .35rem 0;
    border-bottom: 1px dashed var(--line);
}

.order-item:last-child { border-bottom: none; }
.order-item-name { font-weight: 600; }
.order-item-price { font-weight: 700; color: var(--accent); white-space: nowrap; }

.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); }

.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); }

/* ---------- 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) {
    header h1 { font-size: 1.05rem; }
    .cart-btn, .admin-btn { padding: .5rem .85rem; font-size: .85rem; }
    .products { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .9rem; }
    .product img { height: 150px; }
    .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; }
    .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 .85rem; }
    .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 { gap: .5rem; }
    header h1 {
        font-size: .98rem;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    header h1::before { width: 26px; height: 26px; border-radius: 8px; }
    .site-logo { height: 26px; max-width: min(40vw, 130px); }
    .header-actions { flex-shrink: 0; gap: .4rem; }
    .cart-btn, .admin-btn { padding: .45rem .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 .75rem; background-position: right .6rem center; }
}

@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;
}
@media (max-width: 560px) {
    .docs th { white-space: normal; }
}

