.cat-premium-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cat-premium-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.cat-premium-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cat-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.cat-crumbs a {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.cat-crumbs a:hover {
    text-decoration: underline;
}

.cat-crumbs span {
    color: #94a3b8;
}

.cat-edit-panel,
.cat-create-panel {
    margin-bottom: 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    padding: 1rem 1.1rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.08);
}

.cat-edit-form__head {
    margin-bottom: 0.85rem;
}

.cat-edit-form__title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0f172a;
}

.cat-edit-form__grid {
    display: grid;
    gap: 0.85rem;
}

@media (min-width: 768px) {
    .cat-edit-form__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cat-edit-form__checks {
        grid-column: 1 / -1;
    }
}

.cat-edit-form__checks {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.cat-edit-form__preview {
    margin-top: 0.85rem;
    width: 120px;
    aspect-ratio: 1;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.cat-edit-form__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-edit-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.cat-edit-form__delete {
    margin-top: 0.65rem;
}

.cat-row-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.95rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.cat-row--link {
    text-decoration: none;
    color: inherit;
}

.cat-row--link:hover {
    border-color: #c7d2fe;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.08);
    transform: translateY(-1px);
}

.cat-row-main {
    flex: 1;
    min-width: 0;
}

.cat-row-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
}

.cat-row-meta {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: #64748b;
}

.cat-row-chevron {
    font-size: 1.25rem;
    line-height: 1;
    color: #94a3b8;
    flex-shrink: 0;
}

.cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.cat-chip:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.cat-section {
    margin-bottom: 1.35rem;
}

.cat-section-label {
    margin-bottom: 0.55rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #334155;
}

.cat-product-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cat-product-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cat-product-row:hover {
    border-color: #c7d2fe;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.08);
}

.cat-product-thumb {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
}

.cat-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cat-product-thumb-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    color: #94a3b8;
}

.cat-product-body {
    flex: 1;
    min-width: 0;
}

.cat-product-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
}

.cat-product-price {
    margin-top: 0.15rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #667eea;
}

.cat-product-old-price {
    margin-left: 0.35rem;
    font-weight: 500;
    color: #94a3b8;
    text-decoration: line-through;
}

.cat-product-stocks {
    margin-top: 0.35rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.cat-stock-pill {
    font-size: 0.6875rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}

.cat-stock-pill strong {
    color: #0f172a;
}

.cat-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.875rem;
}

.product-edit-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .product-edit-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-edit-grid-wide {
        grid-column: 1 / -1;
    }
}

.product-edit-preview {
    width: 100%;
    max-width: 220px;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.product-edit-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-attr-grid {
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .product-attr-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.product-stock-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
}

.product-stock-field {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem;
    background: #fff;
}

.product-stock-field-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

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

@media (min-width: 640px) {
    .cat-tree-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (min-width: 1024px) {
    .cat-tree-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .cat-tree-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.admin-ui .cat-tree-card__nav {
    display: block !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    gap: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
}

.admin-ui .cat-tree-card__nav:hover {
    background: none !important;
    border-color: transparent !important;
}

.cat-tree-grid--modal {
    margin-top: 1rem;
}

.cat-tree-card-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
}

.cat-tree-card {
    display: block;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cat-tree-card-wrap--inactive .cat-tree-card {
    opacity: 0.62;
}

.cat-tree-card__bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0.35rem 0.45rem;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.42) 0%, transparent 100%);
}

.cat-tree-card__status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.4rem;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}

.cat-tree-card__status--on {
    background: rgba(22, 163, 74, 0.88);
    color: #fff;
}

.cat-tree-card__status--off {
    background: rgba(239, 68, 68, 0.88);
    color: #fff;
}

.cat-tree-card__dot {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.cat-tree-card__toggle {
    pointer-events: auto;
    margin: 0;
}

.cat-tree-card__switch {
    margin: 0;
}

.cat-tree-card__switch .ta-switch-slider {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.28);
}

.cat-tree-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.cat-tree-card__nav {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    padding: 0;
    margin: 0;
    border: 0;
    background: none !important;
    background-color: transparent !important;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.cat-edit-form__media {
    grid-column: 1 / -1;
}

.cat-modal-body .cat-edit-form__media {
    margin-bottom: .875rem;
}

@media (min-width: 768px) {
    .cat-edit-form__media {
        grid-column: span 1;
    }
}

.cat-media-slot {
    position: relative;
    width: 100%;
    max-width: 160px;
    aspect-ratio: 1;
}

.cat-media-slot.is-empty .cat-media-slot__filled {
    display: none;
}

.cat-media-slot.is-filled .cat-media-slot__empty {
    display: none;
}

.cat-media-slot__filled,
.cat-media-slot__empty {
    position: absolute;
    inset: 0;
    border-radius: 0.85rem;
}

.cat-media-slot__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0;
    border: 2px dashed #cbd5e1;
    background: repeating-linear-gradient(-45deg, rgba(148, 163, 184, 0.07) 0, rgba(148, 163, 184, 0.07) 7px, transparent 7px, transparent 14px), #f8fafc;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cat-media-slot__empty:hover,
.cat-media-slot__empty:focus-within {
    border-color: #667eea;
    background-color: #eef2ff;
}

.cat-media-slot__file {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.cat-media-slot__add-icon {
    position: relative;
    z-index: 1;
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    color: #94a3b8;
    pointer-events: none;
    user-select: none;
}

.cat-media-slot__add-text {
    position: relative;
    z-index: 1;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    color: #64748b;
    padding: 0 0.35rem;
    pointer-events: none;
    user-select: none;
}

.cat-media-slot__filled {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f1f5f9;
}

.cat-media-slot__filled img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cat-media-slot__filled img:not([src]),
.cat-media-slot__filled img[src=""] {
    display: none;
}

.cat-media-slot__delete {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    z-index: 3;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: none;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.38);
}

.cat-tree-card__cover {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    overflow: hidden;
    isolation: isolate;
}

.cat-tree-card__cover--has-image {
    background: #0f172a;
}

.cat-tree-card__cover img {
    position: relative;
    z-index: 0;
    width: 100%;
    height: auto;
    display: block;
    vertical-align: top;
}

.cat-tree-card__cover--no-image {
    aspect-ratio: 4 / 3;
    min-height: 6.5rem;
}

.cat-tree-card__shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0.72) 100%);
    pointer-events: none;
}

.cat-tree-card__cover--no-image .cat-tree-card__shade {
    display: none;
}

.cat-tree-card__content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.55rem 0.65rem;
    z-index: 3;
    pointer-events: none;
}

.cat-tree-card__title {
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
}

.cat-tree-card__meta {
    margin-top: 0.15rem;
    font-size: 0.6875rem;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.82);
}

.cat-tree-card__cover--no-image .cat-tree-card__title {
    color: #0f172a;
}

.cat-tree-card__cover--no-image .cat-tree-card__meta {
    color: #64748b;
}

.cat-modal-backdrop,
.cat-branch-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.55);
}

.cat-modal-backdrop[hidden],
.cat-branch-backdrop[hidden] {
    display: none;
}

.cat-modal,
.cat-branch-dialog {
    width: min(100%, 28rem);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.cat-branch-dialog {
    width: min(100%, 56rem);
}

.cat-modal-head,
.cat-branch-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #e2e8f0;
}

.cat-modal-title,
.cat-branch-title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0f172a;
}

.cat-branch-close,
.cat-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.cat-modal-body,
.cat-branch-body {
    padding: 1rem 1.1rem 1.1rem;
}

.cat-modal-foot {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.1rem 1.1rem;
}

.cat-branch-loading {
    padding: 2rem 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
}

.cat-branch-body .cat-edit-panel {
    margin-bottom: 0;
    border: 0;
    box-shadow: none;
    padding: 0;
}

html.dark .cat-edit-panel,
html.dark .cat-create-panel,
html.dark .cat-row,
html.dark .cat-modal,
html.dark .cat-branch-dialog {
    background: #1e293b;
    border-color: #334155;
}

html.dark .cat-edit-form__title,
html.dark .cat-row-title,
html.dark .cat-modal-title,
html.dark .cat-branch-title {
    color: #f1f5f9;
}

html.dark .cat-row-meta,
html.dark .cat-branch-loading,
html.dark .cat-empty {
    color: #94a3b8;
}

html.dark .cat-crumbs span {
    color: #64748b;
}
