:root {
    color-scheme: dark;
    --bg: #07080a;
    --panel: #111319;
    --panel-2: #171a22;
    --line: rgba(255, 255, 255, 0.1);
    --text: #f5f2ea;
    --muted: #a9a295;
    --gold: #d7b86a;
    --gold-2: #f1d88c;
    --danger: #ff5c5c;
    --green: #4fd18b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.public-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px clamp(14px, 4vw, 42px);
    background: rgba(7, 8, 10, 0.86);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(215, 184, 106, 0.55);
    background: #121111;
    color: var(--gold-2);
    font-size: 12px;
    font-weight: 900;
}

.desktop-section-tabs {
    display: none;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    justify-content: center;
}

.section-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.section-tab-icon {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.section-tab svg {
    width: 18px;
    height: 18px;
}

.desktop-section-tabs .cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
}

.section-tab.active,
.section-tab:hover {
    background: var(--panel-2);
    color: var(--gold-2);
}

.section-tab-button {
    appearance: none;
}

.public-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
}

.cart-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
}

.cart-count {
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--gold);
    color: #101010;
    font-size: 12px;
    font-weight: 800;
}

.cart-count[hidden] {
    display: none;
}

.public-main {
    width: min(960px, 100%);
    margin: 0 auto;
    padding: 18px clamp(14px, 4vw, 28px) 108px;
}

.shop-hero,
.page-heading,
.admin-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 0;
}

.shop-hero h1,
.page-heading h1,
.admin-heading h1 {
    margin: 0;
    font-size: clamp(30px, 6vw, 54px);
    line-height: 0.95;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--gold-2);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.help-link,
.muted-link {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.search-bar,
.admin-filter {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 12px 0 16px;
}

.search-bar {
    display: block;
}

.search-field {
    position: relative;
}

.search-field input {
    padding-right: 54px;
}

.search-submit {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: var(--gold);
    color: #101010;
    padding: 0;
}

.search-submit svg {
    width: 19px;
    height: 19px;
}

.admin-filter > input[name="q"] {
    flex: 1 1 320px;
}

.admin-filter > select {
    flex: 0 1 320px;
}

.admin-filter > button {
    flex: 0 0 auto;
}

.search-bar input,
.admin-filter input,
.admin-filter select,
.checkout-form input,
.checkout-form textarea,
.checkout-form select,
.auth-panel input,
.admin-form input,
.admin-form textarea,
.admin-form select,
.settings-layout input,
.settings-layout textarea,
.settings-layout select,
.detail-grid select {
    width: 100%;
    border: 1px solid var(--line);
    background: #0d0f14;
    color: var(--text);
    padding: 12px;
    border-radius: 8px;
    outline: none;
}

.search-bar button,
.admin-filter button,
.primary-action,
.secondary-action,
.icon-action,
.qty-form button {
    border: 0;
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 800;
}

.search-bar .search-submit {
    width: 40px;
    height: 40px;
    padding: 0;
}

.search-bar .search-field input {
    padding-right: 54px;
}

.primary-action {
    background: var(--gold);
    color: #0d0d0d;
}

.secondary-action {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--line);
}

.secondary-action.compact {
    padding: 8px 10px;
}

.as-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.shop-catalog-shell {
    position: relative;
    min-height: 220px;
}

.catalog-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.16);
    border-top-color: var(--gold-2);
    border-radius: 999px;
    box-shadow: 0 0 0 10px rgba(7, 8, 10, 0.42);
    animation: catalog-spin 0.85s linear infinite;
}

.catalog-inline-loading {
    min-height: 94px;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 8px;
    padding: 10px;
    color: var(--muted);
    font-weight: 700;
}

.catalog-inline-loading .catalog-spinner {
    justify-self: center;
}

@keyframes catalog-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.category-slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    touch-action: pan-x;
}

.category-slider::-webkit-scrollbar,
.subcategory-list::-webkit-scrollbar {
    display: none;
}

.category-chip,
.subcategory-list a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: var(--panel);
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
}

.category-chip svg {
    width: 16px;
    height: 16px;
}

.category-chip.active,
.subcategory-list a.active,
.subcategory-list a:hover {
    color: #15110a;
    background: var(--gold-2);
}

.subcategory-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    touch-action: pan-x;
}

.category-slider.dragging,
.subcategory-list.dragging {
    cursor: grabbing;
    user-select: none;
}

.product-list,
.cart-list,
.order-history {
    display: grid;
    gap: 10px;
}

.product-row,
.cart-row,
.order-card,
.suggestion-card {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 8px;
    padding: 10px;
}

.product-image img,
.cart-row img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    background: #0f0f0f;
}

.product-info {
    min-width: 0;
}

.product-info strong,
.cart-row strong,
.order-card strong {
    display: block;
    overflow-wrap: anywhere;
}

.product-info span,
.cart-row span,
td span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.product-info em {
    display: block;
    margin-top: 7px;
    color: var(--gold-2);
    font-style: normal;
    font-weight: 800;
}

.product-cell {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.product-thumb img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    background: #0f0f0f;
}

.icon-action {
    width: 42px;
    height: 42px;
    padding: 0;
    background: var(--gold);
    color: #0b0b0b;
    font-size: 22px;
}

.detail-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.detail-body h1 {
    margin: 18px 0 12px;
    font-size: clamp(28px, 7vw, 48px);
    line-height: 1;
}

.detail-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--gold-2);
    font-size: 14px;
}

.detail-body p {
    color: #ddd6c8;
    line-height: 1.6;
}

.product-layer-open {
    overflow: hidden;
}

.product-detail-layer {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    overflow-y: auto;
    background: rgba(7, 8, 10, 0.72);
}

.product-detail-layer.is-open {
    display: block;
}

.product-detail-panel {
    min-height: 100%;
    width: min(960px, 100%);
    margin: 0 auto;
    padding: 0 clamp(14px, 4vw, 28px) 28px;
    background: var(--bg);
    box-shadow: 0 0 0 1px var(--line), 0 24px 80px rgba(0, 0, 0, 0.42);
}

.product-layer-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    padding: 14px 0;
    background: rgba(7, 8, 10, 0.86);
    backdrop-filter: blur(16px);
}

.product-detail-layer .sticky-buy {
    position: sticky;
    left: auto;
    bottom: 14px;
    transform: none;
    width: 100%;
    margin-top: 18px;
}

.profile-panel,
.order-detail-list {
    display: grid;
    gap: 12px;
}

.profile-card {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 8px;
    padding: 18px;
}

.profile-card h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

.profile-card p {
    margin: 0 0 8px;
    color: #ddd6c8;
}

.order-list-row,
.order-detail-row {
    display: grid;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 8px;
    padding: 12px;
}

.order-list-row {
    grid-template-columns: minmax(0, 1.15fr) auto auto auto auto;
}

.order-detail-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.order-detail-row.has-product {
    grid-template-columns: 72px minmax(0, 1fr) auto auto;
}

.order-id-link {
    min-width: 0;
}

.order-id-link span,
.order-subtitle {
    color: var(--muted);
}

.order-title-inline {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    font-size: clamp(18px, 3vw, 26px);
    line-height: 1.2;
}

.order-title-inline span {
    color: var(--muted);
    font-size: 0.88em;
    font-weight: 600;
}

.order-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.status-unfinished {
    background: rgba(255, 92, 92, 0.14);
    border-color: rgba(255, 92, 92, 0.32);
    color: #ffb8b8;
}

.status-new {
    background: rgba(88, 166, 255, 0.16);
    border-color: rgba(88, 166, 255, 0.38);
    color: #9ecbff;
}

.status-assembling {
    background: rgba(215, 184, 106, 0.18);
    border-color: rgba(215, 184, 106, 0.42);
    color: var(--gold-2);
}

.status-delivering {
    background: rgba(173, 127, 255, 0.18);
    border-color: rgba(173, 127, 255, 0.42);
    color: #d2baff;
}

.status-delivered {
    background: rgba(79, 209, 139, 0.16);
    border-color: rgba(79, 209, 139, 0.4);
    color: #9bf0bf;
}

.order-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.sticky-buy {
    position: fixed;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    width: min(920px, calc(100% - 28px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(17, 19, 25, 0.95);
    backdrop-filter: blur(16px);
}

.sticky-buy span {
    color: var(--gold-2);
    font-weight: 900;
}

.sticky-buy button {
    border: 0;
    border-radius: 8px;
    background: var(--gold);
    color: #101010;
    padding: 12px 18px;
    font-weight: 900;
}

.sticky-buy button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sheet-dialog {
    width: min(520px, calc(100% - 18px));
    margin: auto auto 12px;
    padding: 0;
    border: 0;
    background: transparent;
}

.sheet-dialog::backdrop {
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(6px);
}

.sheet-handle {
    width: 48px;
    height: 5px;
    border-radius: 999px;
    margin: 0 auto 10px;
    background: rgba(255, 255, 255, 0.2);
}

.sheet-body {
    display: grid;
    gap: 14px;
    padding: 14px 16px 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #111319;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
}

.sheet-body h2 {
    margin: 0;
    font-size: 22px;
}

.sheet-body p {
    margin: 0;
    color: var(--muted);
}

.topbar-link {
    color: var(--muted);
    font-weight: 700;
}

.topbar-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.header-icon-button {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--gold-2);
}

.header-icon-button svg {
    width: 20px;
    height: 20px;
}

.telegram-link {
    gap: 10px;
}

.telegram-link svg,
.bottom-nav-icon svg {
    width: 20px;
    height: 20px;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 30;
    transform: translateX(-50%);
    width: min(960px, 100%);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 10px clamp(10px, 4vw, 22px) calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(7, 8, 10, 0.92);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.bottom-nav-link {
    min-width: 0;
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 8px 6px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.bottom-nav-link.active,
.bottom-nav-link:hover {
    color: var(--gold-2);
}

.bottom-nav-button {
    appearance: none;
}

.bottom-nav-icon {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
}

.bottom-nav .cart-count {
    position: absolute;
    top: -7px;
    right: -11px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
}

.toast-stack {
    position: fixed;
    left: 50%;
    bottom: 92px;
    z-index: 40;
    transform: translateX(-50%);
    width: min(440px, calc(100% - 24px));
    display: grid;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(17, 19, 25, 0.96);
    color: var(--text);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-color: rgba(79, 209, 139, 0.45);
}

.toast-error {
    border-color: rgba(255, 92, 92, 0.45);
}

.cart-row {
    grid-template-columns: 64px minmax(0, 1fr) auto;
}

.cart-row img {
    width: 64px;
    height: 64px;
}

.qty-form {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #0d0f14;
    padding: 6px;
}

.qty-form input {
    width: 64px;
    min-width: 0;
    border: 0;
    background: transparent;
    text-align: center;
    padding: 6px 4px;
}

.qty-button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--panel-2);
    color: var(--text);
    padding: 0;
}

.qty-button svg {
    width: 16px;
    height: 16px;
}

.qty-remove-button {
    color: #ffb8b8;
}

.cart-item-total {
    display: block;
    margin-top: 8px;
    color: var(--gold-2);
    font-style: normal;
    font-weight: 800;
}

.cart-summary,
.success-panel,
.auth-panel,
.legal-page,
.age-panel,
.empty-state {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 8px;
    padding: 18px;
}

.cart-summary {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.cart-summary strong {
    color: var(--gold-2);
    font-size: 24px;
}

.checkout-form,
.auth-panel form,
.admin-form,
.settings-layout {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.inline-error {
    border: 1px solid rgba(255, 92, 92, 0.45);
    background: rgba(255, 92, 92, 0.12);
    color: #ffd4d4;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.age-shell {
    background:
        linear-gradient(180deg, rgba(7, 8, 10, 0.3), var(--bg)),
        url("https://images.unsplash.com/photo-1519608487953-e999c86e7455?auto=format&fit=crop&w=1600&q=80") center/cover fixed;
}

.age-gate {
    min-height: calc(100vh - 80px);
    display: grid;
    place-items: center;
}

.age-panel {
    width: min(460px, 100%);
    background: rgba(17, 19, 25, 0.92);
}

.age-kicker {
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 1px solid var(--gold);
    color: var(--gold-2);
    font-weight: 900;
    margin-bottom: 12px;
}

.age-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 18px 0;
}

.legal-page {
    line-height: 1.6;
}

.legal-warning {
    color: var(--gold-2);
}

details {
    border-top: 1px solid var(--line);
    padding: 14px 0;
}

summary {
    cursor: pointer;
    font-weight: 800;
}

.admin-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    background: #06070a;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px;
    border-right: 1px solid var(--line);
    background: #08090d;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.admin-sidebar nav {
    display: grid;
    gap: 6px;
}

.admin-sidebar nav a {
    padding: 11px 12px;
    color: var(--muted);
    border-radius: 8px;
}

.admin-sidebar nav a.active,
.admin-sidebar nav a:hover {
    background: var(--panel-2);
    color: var(--gold-2);
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.admin-user {
    margin-top: auto;
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.admin-main {
    padding: 26px clamp(18px, 4vw, 42px);
    min-width: 0;
}

.admin-section-loading {
    min-height: min(520px, calc(100vh - 52px));
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    color: var(--muted);
    font-weight: 800;
}

.admin-login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #050609;
}

.admin-login-panel {
    width: min(420px, calc(100% - 28px));
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 8px;
    padding: 26px;
}

.admin-login-panel form {
    display: grid;
    gap: 14px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.metric-card {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 8px;
    padding: 18px;
}

.metric-card span {
    color: var(--muted);
}

.metric-card strong {
    display: block;
    margin-top: 10px;
    font-size: 30px;
    color: var(--gold-2);
}

.chart-band,
.split-band > div,
.settings-layout section,
.product-side,
.ai-suggestions,
.detail-grid > div,
.detail-grid form {
    margin-top: 18px;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 8px;
    padding: 18px;
}

.template-settings {
    display: grid;
    gap: 18px;
}

.template-settings label {
    gap: 10px;
}

.revenue-chart {
    min-height: 190px;
    display: flex;
    align-items: end;
    gap: 8px;
    border-bottom: 1px solid var(--line);
}

.bar {
    width: 30px;
    min-height: 20px;
    background: linear-gradient(180deg, var(--gold-2), #8d6b29);
    border-radius: 6px 6px 0 0;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    background: var(--panel);
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

td a {
    color: var(--gold-2);
}

.table-meta {
    color: var(--muted);
}

.table-sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
}

.table-sort span {
    color: var(--gold-2);
    min-width: 10px;
}

.danger-icon {
    border: 1px solid rgba(255, 92, 92, 0.4);
    background: rgba(255, 92, 92, 0.12);
    color: #ffd4d4;
    border-radius: 8px;
    padding: 8px 10px;
    font-weight: 900;
}

.danger-icon.armed {
    border-color: var(--gold);
    background: rgba(215, 184, 106, 0.2);
    color: var(--gold-2);
}

.danger-action {
    border-color: rgba(255, 92, 92, 0.4);
    color: #ffd4d4;
}

.danger-action.armed {
    border-color: var(--gold);
    background: rgba(215, 184, 106, 0.2);
    color: var(--gold-2);
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-title-row h2 {
    margin: 0;
}

.detail-grid,
.product-edit-grid,
.split-band,
.catalog-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    gap: 18px;
    align-items: start;
}

.catalog-admin-grid {
    grid-template-columns: 250px minmax(0, 1fr);
}

.catalog-admin-grid.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
}

.catalog-admin-grid.sidebar-collapsed .category-tree {
    display: none;
}

.category-tree {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 8px;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.category-tree a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--muted);
}

.category-tree a.child {
    margin-left: 14px;
}

.category-tree a.active {
    color: var(--gold-2);
    background: var(--panel-2);
}

.category-group {
    margin: 0;
    padding: 0;
    border-top: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0d0f14;
    overflow: hidden;
}

.category-group summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text);
}

.category-group summary::-webkit-details-marker {
    display: none;
}

.category-group summary::before {
    content: "▸";
    color: var(--gold-2);
    transition: transform 0.18s ease;
    margin-right: 2px;
}

.category-group[open] summary::before {
    transform: rotate(90deg);
}

.category-group-links {
    display: grid;
    gap: 4px;
    padding: 0 8px 8px;
}

.category-count {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

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

.filterable-select {
    display: grid;
    gap: 8px;
    min-width: 220px;
}

.filterable-select input,
.filterable-select select {
    width: 100%;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

.check-row input {
    width: auto;
}

.product-side img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
}

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

.product-ai-actions button {
    width: 100%;
}

.file-picker {
    position: relative;
    width: 100%;
    overflow: hidden;
    cursor: pointer;
}

.file-picker input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.status-flow-card h2 {
    margin-top: 0;
}

.status-flow {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
}

.status-pill {
    width: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    text-align: left;
}

.status-pill.active {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.status-step {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: inherit;
    font-size: 11px;
    font-weight: 900;
}

.status-pill.status-new {
    background: rgba(88, 166, 255, 0.18);
    border-color: rgba(88, 166, 255, 0.42);
    color: #b6d8ff;
}

.status-pill.status-assembling {
    background: rgba(215, 184, 106, 0.18);
    border-color: rgba(215, 184, 106, 0.42);
    color: var(--gold-2);
}

.status-pill.status-delivering {
    background: rgba(173, 127, 255, 0.18);
    border-color: rgba(173, 127, 255, 0.42);
    color: #d2baff;
}

.status-pill.status-delivered {
    background: rgba(79, 209, 139, 0.18);
    border-color: rgba(79, 209, 139, 0.42);
    color: #9bf0bf;
}

.status-pill.status-unfinished {
    background: rgba(255, 92, 92, 0.16);
    border-color: rgba(255, 92, 92, 0.36);
    color: #ffb8b8;
}

dl {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px;
    color: var(--muted);
}

dd {
    margin: 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

.suggestion-card {
    grid-template-columns: 96px 1fr auto;
    margin-top: 10px;
}

.suggestion-card img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
}

.log-dialog {
    width: min(760px, calc(100% - 28px));
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: 8px;
    padding: 20px;
}

.log-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
}

pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: #d5d0c5;
}

.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 7px;
    background: var(--danger);
}

.status-dot.ok {
    background: var(--green);
}

tr.user-pending {
    background: rgba(241, 216, 140, 0.12);
}

tr.user-pending td:first-child {
    border-left: 4px solid rgba(241, 216, 140, 0.75);
}

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

.inline-check-form {
    display: inline-flex;
    align-items: center;
}

.table-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.table-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--gold);
}

.inline-form select {
    min-width: 170px;
    border: 1px solid var(--line);
    background: #0d0f14;
    color: var(--text);
    padding: 8px;
    border-radius: 8px;
}

.inline-form button {
    border: 0;
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--text);
    padding: 8px 10px;
    font-weight: 800;
}

.import-progress {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
}

.import-progress.hidden {
    display: none;
}

.import-progress div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

progress {
    width: 100%;
    height: 14px;
    accent-color: var(--gold);
}

.icon-button {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--text);
}

.icon-button svg,
.icon-text-button svg {
    width: 18px;
    height: 18px;
}

.secondary-icon {
    background: transparent;
}

.icon-text-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.table-actions form {
    margin: 0;
}

.table-actions-head {
    width: 92px;
}

.sidebar-toggle-row {
    margin-bottom: 14px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.pagination-meta {
    color: var(--muted);
}

.log-preview {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.log-preview-text,
.log-preview-pre {
    display: block;
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: #d5d0c5;
}

.dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.manager-bind-cell {
    display: grid;
    gap: 8px;
    min-width: 180px;
}

@media (min-width: 861px) {
    .desktop-section-tabs {
        display: flex;
    }

    .bottom-nav {
        display: none;
    }
}

@media (max-width: 860px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
    }

    .admin-sidebar nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-grid,
    .detail-grid,
    .product-edit-grid,
    .split-band,
    .catalog-admin-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .order-list-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .order-list-row > :nth-child(2),
    .order-list-row > :nth-child(3),
    .order-list-row > :nth-child(4) {
        grid-column: 1 / -1;
    }

    .order-list-row form {
        justify-self: end;
    }

    .status-pill {
        width: 100%;
        justify-content: flex-start;
    }

    .status-flow {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .public-topbar,
    .shop-hero,
    .page-heading,
    .admin-heading,
    .cart-summary,
    .sticky-buy,
    .order-detail-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .public-nav {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
        font-size: 13px;
    }

    .desktop-section-tabs {
        display: none;
    }

    .search-bar,
    .admin-filter {
        flex-direction: column;
    }

    .product-row {
        grid-template-columns: 64px 1fr 42px;
    }

    .product-image img {
        width: 64px;
        height: 64px;
    }

    .cart-row,
    .suggestion-card,
    .order-detail-row {
        grid-template-columns: 1fr;
    }

    .order-detail-row.has-product {
        grid-template-columns: 1fr;
    }

    .sheet-dialog {
        width: calc(100% - 12px);
        margin-bottom: 6px;
    }

    .status-flow {
        grid-template-columns: 1fr;
    }

    .section-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .product-ai-actions {
        grid-template-columns: 1fr;
    }
}
