:root {
    --bg: #f5f1ec;
    --surface: #ffffff;
    --surface-2: #faf7f3;
    --surface-3: #f1ebe4;
    --ink: #1d1512;
    --ink-2: #4a3d37;
    --muted: #8a7c73;
    --line: #ebe3da;
    --line-2: #ddd2c6;
    --accent: #c8102e;
    --accent-hover: #a90d26;
    --accent-soft: #fbe8eb;
    --side: #1b110d;
    --side-2: #2a1c16;
    --side-ink: #f3e9df;
    --side-muted: #a8968a;
    --green: #1f8a5b;
    --green-soft: #e3f4ec;
    --amber: #b26a12;
    --amber-soft: #fbf0dc;
    --gray-soft: #eeeae6;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(29, 21, 18, .04), 0 8px 24px -12px rgba(29, 21, 18, .12);
    --shadow-lg: 0 30px 80px -20px rgba(29, 21, 18, .35);
    --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

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

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

.hidden {
    display: none !important;
}

.layout {
    display: grid;
    grid-template-columns: 264px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 26px 18px;
    background: var(--side);
    color: var(--side-ink);
    background-image: radial-gradient(120% 60% at 0% 0%, rgba(200, 16, 46, .28), transparent 60%);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
}

.logo-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    letter-spacing: .02em;
    box-shadow: 0 10px 24px -10px rgba(200, 16, 46, .9);
}

.logo-title {
    font-weight: 800;
    font-size: 16px;
    line-height: 1.1;
}

.logo-sub {
    color: var(--side-muted);
    font-size: 12px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-label {
    margin: 8px 12px 6px;
    color: var(--side-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    color: var(--side-ink);
    font-weight: 600;
    opacity: .78;
    transition: background .15s, opacity .15s;
}

.nav a:hover {
    background: rgba(255, 255, 255, .06);
    opacity: 1;
}

.nav a.active {
    background: rgba(255, 255, 255, .1);
    opacity: 1;
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav svg {
    width: 20px;
    height: 20px;
    flex: none;
}

.nav .count {
    margin-left: auto;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    font-size: 12px;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    border-radius: 14px;
    background: var(--side-2);
}

.avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #e8731f, var(--accent));
    color: #fff;
    font-weight: 800;
}

.sidebar-footer .who {
    min-width: 0;
    flex: 1;
}

.sidebar-footer .name {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer .login {
    color: var(--side-muted);
    font-size: 12px;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, .08);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.main {
    min-width: 0;
    padding: 32px 40px 80px;
}

.topbar {
    display: none;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}

.crumbs {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.crumbs a:hover {
    color: var(--accent);
}

h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
}

h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.page-sub {
    margin-top: 4px;
    color: var(--muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .05s;
}

.btn:hover {
    background: var(--surface-2);
    border-color: var(--muted);
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: .6;
    cursor: default;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 22px -12px rgba(200, 16, 46, .8);
}

.btn-primary:hover {
    border-color: var(--accent-hover);
    background: var(--accent-hover);
}

.btn-dark {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.btn-dark:hover {
    background: #000;
    border-color: #000;
}

.btn-danger {
    border-color: #f1c7cd;
    background: var(--accent-soft);
    color: var(--accent);
}

.btn-danger:hover {
    border-color: var(--accent);
    background: #f8d9de;
}

.btn-ghost {
    border-color: transparent;
    background: transparent;
}

.btn-sm {
    height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 0;
}

.card-head p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.card-body {
    padding: 20px 22px 22px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.stat {
    position: relative;
    overflow: hidden;
    padding: 20px 22px;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.stat-value {
    margin-top: 6px;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1;
}

.stat-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.stat-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--surface-3);
    color: var(--ink-2);
}

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

.stat.accent {
    border-color: transparent;
    background: linear-gradient(140deg, #2a1610, #c8102e 140%);
    color: #fff;
}

.stat.accent .stat-label, .stat.accent .stat-note {
    color: rgba(255, 255, 255, .75);
}

.stat.accent .stat-icon {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
}

.bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bar-row {
    display: grid;
    grid-template-columns: 150px 1fr 36px;
    align-items: center;
    gap: 14px;
}

.bar-name {
    font-weight: 700;
}

.bar-name small {
    display: block;
    color: var(--muted);
    font-weight: 500;
    font-size: 12px;
}

.bar-track {
    height: 10px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #e8731f, var(--accent));
}

.bar-value {
    text-align: right;
    font-weight: 800;
}

.recent {
    display: flex;
    flex-direction: column;
}

.recent a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.recent a:first-child {
    border-top: 0;
    padding-top: 0;
}

.recent a:hover .recent-title {
    color: var(--accent);
}

.thumb {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--surface-3) center / 82% no-repeat;
    background-size: contain;
    background-origin: content-box;
    padding: 4px;
    border: 1px solid var(--line);
}

.recent-title {
    font-weight: 700;
    line-height: 1.3;
}

.recent-meta {
    color: var(--muted);
    font-size: 12px;
}

.chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--gray-soft);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.chip::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: .7;
}

.chip.plain::before {
    display: none;
}

.chip.active {
    background: var(--green-soft);
    color: var(--green);
}

.chip.draft {
    background: var(--amber-soft);
    color: var(--amber);
}

.chip.archived {
    background: var(--gray-soft);
    color: var(--muted);
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 12px;
}

.search {
    position: relative;
    flex: 1 1 220px;
}

.search svg {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--muted);
    transform: translateY(-50%);
}

.search input {
    padding-left: 42px;
}

.input, .select, .textarea {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: var(--surface);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.textarea {
    height: auto;
    min-height: 120px;
    padding: 12px 14px;
    resize: vertical;
    line-height: 1.55;
}

.select {
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%238a7c73' stroke-width='2'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    cursor: pointer;
}

.input:focus, .select:focus, .textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(200, 16, 46, .1);
}

.toolbar .select {
    width: auto;
    min-width: 150px;
}

.segmented {
    display: inline-flex;
    padding: 4px;
    border-radius: 12px;
    background: var(--surface-3);
}

.segmented button {
    height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.segmented button.on {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.segmented svg {
    display: block;
    width: 18px;
    height: 18px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}

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

.product-media {
    position: relative;
    aspect-ratio: 1;
    background: radial-gradient(circle at 50% 40%, #fff, var(--surface-3));
}

.product-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 18px;
    transition: transform .3s;
}

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

.product-media .chip {
    position: absolute;
    z-index: 1;
    top: 12px;
    left: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.photo-count {
    position: absolute;
    z-index: 1;
    right: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(29, 21, 18, .7);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.photo-count svg {
    width: 14px;
    height: 14px;
}

.no-photo {
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.no-photo svg {
    width: 34px;
    height: 34px;
    margin: 0 auto 6px;
    opacity: .6;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    padding: 16px 18px 18px;
    border-top: 1px solid var(--line);
}

.product-brand {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.product-title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.3;
}

.product-sub {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.product-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
}

.price {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.price small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.product-cat {
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}

.table-wrap {
    overflow-x: auto;
}

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

.table th {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

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

.table tbody tr.clickable {
    cursor: pointer;
}

.table tbody tr.clickable:hover td {
    background: var(--surface-2);
}

.table .cell-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table .muted {
    color: var(--muted);
    font-size: 13px;
}

.right {
    text-align: right !important;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 26px;
}

.pagination span {
    color: var(--muted);
    font-weight: 600;
}

.empty {
    display: grid;
    place-items: center;
    gap: 10px;
    padding: 70px 20px;
    text-align: center;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: var(--surface-3);
    color: var(--muted);
}

.empty-icon svg {
    width: 28px;
    height: 28px;
}

.empty h3 {
    margin: 4px 0 0;
    font-size: 18px;
}

.empty p {
    margin: 0;
    max-width: 380px;
    color: var(--muted);
}

.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 20px;
}

.form-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-side {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-num {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
}

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

.fields.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.field.full {
    grid-column: 1 / -1;
}

.field label, .label {
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
}

.field label .req {
    color: var(--accent);
}

.hint {
    color: var(--muted);
    font-size: 12px;
}

.input-group {
    display: flex;
}

.input-group .input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .select {
    width: 90px;
    flex: none;
    border-left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 28px 20px;
    border: 2px dashed var(--line-2);
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--muted);
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.dropzone:hover, .dropzone.drag {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.dropzone svg {
    width: 30px;
    height: 30px;
}

.dropzone strong {
    color: var(--ink);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.gallery:empty {
    display: none;
}

.photo {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
}

.photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.photo.main {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, .14);
}

.photo .badge {
    position: absolute;
    z-index: 1;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.photo .badge.pending {
    background: var(--amber);
}

.photo-actions {
    position: absolute;
    z-index: 1;
    inset: auto 0 0 0;
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    background: linear-gradient(transparent, rgba(29, 21, 18, .7));
    opacity: 0;
    transition: opacity .15s;
}

.photo:hover .photo-actions {
    opacity: 1;
}

.photo-actions button {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .92);
    color: var(--ink);
    cursor: pointer;
}

.photo-actions button:hover {
    background: #fff;
    color: var(--accent);
}

.photo-actions svg {
    width: 16px;
    height: 16px;
}

.variants {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.variant-head, .variant-row {
    display: grid;
    grid-template-columns: minmax(150px, 2fr) minmax(100px, 1.2fr) 70px 100px 100px 54px 54px 36px;
    align-items: center;
    gap: 8px;
}

.variant-head {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.variant-row .input {
    height: 38px;
    padding: 0 10px;
    border-radius: 10px;
}

.variant-row .check {
    display: grid;
    place-items: center;
}

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

.remove-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.remove-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.remove-btn svg {
    width: 18px;
    height: 18px;
}

.add-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 6px 2px;
    border: 0;
    background: none;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
}

.add-link svg {
    width: 18px;
    height: 18px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 6px 8px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: var(--surface);
    cursor: text;
}

.tags:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(200, 16, 46, .1);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px 4px 10px;
    border-radius: 8px;
    background: var(--surface-3);
    font-size: 13px;
    font-weight: 600;
}

.tag button {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: none;
    color: var(--muted);
    cursor: pointer;
}

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

.tag svg {
    width: 12px;
    height: 12px;
}

.tags input {
    flex: 1;
    min-width: 140px;
    height: 28px;
    border: 0;
    outline: none;
    background: transparent;
}

.attr-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr 36px;
    gap: 8px;
}

.status-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.status-option:hover {
    background: var(--surface-2);
}

.status-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.status-option.on {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.status-option strong {
    display: block;
    font-size: 14px;
}

.status-option span {
    color: var(--muted);
    font-size: 12px;
}

.meta-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    font-size: 13px;
}

.meta-list div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

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

.meta-list dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

.save-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kbd {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.kbd b {
    padding: 1px 6px;
    border: 1px solid var(--line-2);
    border-radius: 6px;
    background: var(--surface-2);
    font-weight: 700;
}

.tree {
    display: flex;
    flex-direction: column;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    border-top: 1px solid var(--line);
}

.tree-item:first-child {
    border-top: 0;
}

.tree-item.child {
    padding-left: 64px;
    background: var(--surface-2);
}

.tree-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 11px;
    background: var(--accent-soft);
    color: var(--accent);
}

.tree-item.child .tree-icon {
    width: 32px;
    height: 32px;
    background: var(--surface-3);
    color: var(--ink-2);
}

.tree-icon svg {
    width: 18px;
    height: 18px;
}

.tree-text {
    flex: 1;
    min-width: 0;
}

.tree-name {
    font-weight: 800;
}

.tree-desc {
    color: var(--muted);
    font-size: 13px;
}

.tree-actions {
    display: flex;
    gap: 6px;
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.brand-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px;
}

.brand-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex: none;
    border-radius: 15px;
    background: linear-gradient(140deg, #2a1610, var(--accent));
    color: #fff;
    font-size: 20px;
    font-weight: 800;
}

.brand-name {
    font-size: 18px;
    font-weight: 800;
}

.brand-desc {
    margin: 0;
    color: var(--ink-2);
    font-size: 14px;
}

.brand-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.brand-foot a {
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(27, 17, 13, .5);
    backdrop-filter: blur(4px);
    animation: fade .15s ease-out;
}

.modal {
    width: min(640px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: pop .2s ease-out;
}

.modal.small {
    width: min(420px, 100%);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 0;
}

.modal-head .icon-btn:hover {
    background: var(--surface-3);
}

.modal-body {
    padding: 20px 24px;
}

.modal-body p {
    margin: 0;
    color: var(--ink-2);
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 24px 22px;
}

.toasts {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
    max-width: 380px;
    padding: 14px 18px;
    border-radius: 14px;
    background: var(--ink);
    color: #fff;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    animation: slide .25s ease-out;
}

.toast::before {
    content: '';
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
    background: #3ddc97;
}

.toast.error::before {
    background: #ff6b7f;
}

.login-page {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    min-height: 100vh;
}

.login-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 48px;
    background: var(--side);
    background-image: radial-gradient(70% 60% at 30% 70%, rgba(200, 16, 46, .55), transparent 70%), radial-gradient(50% 50% at 90% 10%, rgba(232, 115, 31, .35), transparent 70%);
    color: var(--side-ink);
}

.login-visual h2 {
    max-width: 460px;
    font-size: 44px;
    line-height: 1.05;
    letter-spacing: -.03em;
}

.login-visual h2 em {
    color: #ffb27a;
    font-style: normal;
}

.login-visual p {
    max-width: 420px;
    color: var(--side-muted);
}

.login-visual > div:not(.login-products), .login-visual > .logo {
    position: relative;
    z-index: 2;
}

.login-products {
    position: absolute;
    top: 110px;
    left: 8%;
    right: 4%;
    height: calc(100% - 430px);
    min-height: 260px;
    pointer-events: none;
}

.login-products img {
    position: absolute;
    filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .5));
}

.login-products .p1 {
    left: 50%;
    top: 0;
    height: 100%;
    transform: translateX(-50%) rotate(-6deg);
}

.login-products .p2 {
    right: 4%;
    bottom: 0;
    width: 28%;
    transform: rotate(8deg);
    border-radius: 20px;
}

.login-products .p3 {
    left: 4%;
    bottom: 4%;
    width: 26%;
    transform: rotate(-10deg);
    border-radius: 20px;
}

.login-brands {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.login-brands span {
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.login-form-wrap {
    display: grid;
    place-items: center;
    padding: 40px 24px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: min(380px, 100%);
}

.login-form h1 {
    font-size: 28px;
}

.login-error {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
}

.loader {
    display: grid;
    place-items: center;
    min-height: 50vh;
}

.spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--line-2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.skeleton {
    border-radius: var(--radius);
    background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3));
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
}

.backdrop-nav {
    display: none;
}

#product-form[data-lang="ru"] [data-lang="uz"],
#product-form[data-lang="uz"] [data-lang="ru"] {
    display: none !important;
}

.lang-bar {
    position: sticky;
    top: 12px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 18px;
}

.lang-bar-text {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-bar-text svg {
    width: 24px;
    height: 24px;
    flex: none;
    color: var(--accent);
}

.lang-bar-text strong {
    display: block;
}

.lang-bar-text span {
    color: var(--muted);
    font-size: 13px;
}

.lang-switch button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
}

.lang-count {
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--amber-soft);
    color: var(--amber);
    font-size: 11px;
    font-weight: 800;
}

.lang-count.done {
    background: var(--green-soft);
    color: var(--green);
}

.lang-tag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    vertical-align: middle;
}

#product-form[data-lang="ru"] .lang-tag::after {
    content: 'RU';
}

#product-form[data-lang="uz"] .lang-tag {
    background: #e2f1fb;
    color: #1769a8;
}

#product-form[data-lang="uz"] .lang-tag::after {
    content: 'UZ';
}

#product-form[data-lang="uz"] .lang-bar {
    border-color: #b9dcf3;
    box-shadow: 0 0 0 3px #e2f1fb, var(--shadow);
}

.ref {
    display: none;
    padding: 7px 10px;
    border-left: 3px solid var(--line-2);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-line;
}

.ref b {
    color: var(--ink-2);
}

#product-form[data-lang="uz"] .ref:not(:empty) {
    display: block;
}

.variant-row > div .input {
    width: 100%;
}

.chip.lang-ok {
    background: var(--green-soft);
    color: var(--green);
}

.chip.lang-missing {
    background: var(--amber-soft);
    color: var(--amber);
}

.meta-list dd.warn {
    color: var(--amber);
}

.meta-list dd.ok {
    color: var(--green);
}

.lang-mini {
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 5px;
    background: var(--surface-3);
    color: var(--ink-2);
    font-size: 10px;
    font-weight: 800;
}

.title-uz {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

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

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

@keyframes fade {
    from {
        opacity: 0;
    }
}

@keyframes pop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.98);
    }
}

@keyframes slide {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

@media (max-width: 1200px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-layout {
        grid-template-columns: 1fr;
    }

    .form-side {
        position: static;
        order: -1;
    }

    .variant-head {
        display: none;
    }

    .variant-row {
        grid-template-columns: 1fr 1fr 1fr;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 12px;
    }

    .variant-row .check {
        justify-content: start;
        grid-auto-flow: column;
        gap: 6px;
        font-size: 13px;
    }
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 40;
        width: 280px;
        transform: translateX(-100%);
        transition: transform .25s;
    }

    .layout.nav-open .sidebar {
        transform: none;
    }

    .layout.nav-open .backdrop-nav {
        position: fixed;
        inset: 0;
        z-index: 30;
        display: block;
        background: rgba(0, 0, 0, .4);
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        background: var(--side);
        color: var(--side-ink);
        font-weight: 800;
    }

    .main {
        padding: 22px 16px 60px;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .login-page {
        grid-template-columns: 1fr;
    }

    .login-visual {
        min-height: 280px;
        padding: 28px 20px;
    }

    .login-visual h2 {
        font-size: 30px;
    }

    .login-products {
        display: none;
    }
}

@media (max-width: 600px) {
    .stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat {
        padding: 16px;
    }

    .stat-value {
        font-size: 26px;
    }

    .stat-icon {
        display: none;
    }

    .fields, .fields.three {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 24px;
    }

    .bar-row {
        grid-template-columns: 100px 1fr 30px;
    }

    .toolbar .select {
        flex: 1 1 100%;
    }

    .tree-item.child {
        padding-left: 30px;
    }

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

    .product-info {
        padding: 12px;
    }

    .product-foot {
        flex-direction: column;
        align-items: flex-start;
    }

    .product-cat {
        text-align: left;
    }
}
