* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #20252b;
}
a { color: inherit; }
.container { max-width: 1200px; margin: auto; padding: 0 20px; }
.narrow { max-width: 900px; }
.topbar {
    background: #17212b;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.main-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin: 15px 0;
}

.main-content {
    flex: 1;
    min-width: 0;
}

/* Правая часть - меню категорий */
.category-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 5px rgba(0,0,0,.08);
    overflow: hidden;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.category-sidebar-header {
    padding: 15px 18px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8ebee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.category-sidebar-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.category-sidebar-header .toggle-icon {
    font-size: 18px;
    transition: transform 0.3s;
    color: #666;
}

.category-sidebar-header .toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.category-sidebar-body {
    padding: 8px 0;
    overflow-y: auto;
    flex: 1;
}

.category-sidebar-body.collapsed {
    display: none;
}

.dropdown-item {
    position: relative;
}

.dropdown-link {
    display: flex;
    align-items: center;
    padding: 8px 18px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    gap: 4px;
}

.dropdown-link:hover {
    background: #f0f7ff;
    border-left-color: #1976d2;
}


.dropdown-link .icon {
    margin-right: 4px;
    font-size: 16px;
}

.dropdown-link .arrow {
    margin-left: auto;
    font-size: 12px;
    color: #999;
    transition: transform 0.2s;
}

.dropdown-link.active {
    background: #e8f0fe;
    border-left-color: #1976d2;
    font-weight: 600;
    color: #1976d2;
}

.dropdown-link .count {
    font-size: 11px;
    color: #666;
    margin-left: auto;
    background: #e8ebee;
    padding: 0 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.dropdown-link.active .count {
    background: #1976d2;
    color: white;
}

.dropdown-submenu {
    display: none;
    background: #fafafa;
}

.dropdown-submenu.open {
    display: block;
}

.dropdown-submenu .dropdown-link {
    padding-left: 38px !important;
    font-size: 13px;
}

.dropdown-submenu .dropdown-submenu .dropdown-link {
    padding-left: 58px !important;
    font-size: 12px;
}

.dropdown-submenu .dropdown-submenu .dropdown-submenu .dropdown-link {
    padding-left: 78px !important;
    font-size: 11px;
}

/* Стили для поиска */
.search {
    display: grid;
    grid-template-columns: 1fr 180px auto auto;
    gap: 10px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 1px 5px rgba(0,0,0,.08);
}

/* ============================================
   СЕТКА КАРТОЧЕК С ДИНАМИЧЕСКИМИ КОЛОНКАМИ
   ============================================ */
.grid {
    display: grid;
    gap: 18px;
    padding-bottom: 40px;
}

/* 2 колонки */
.grid-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* 3 колонки (по умолчанию) */
.grid-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* 4 колонки */
.grid-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* 5 колонок */
.grid-columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* 6 колонок */
.grid-columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Адаптивность для сетки */
@media (max-width: 1200px) {
    .grid-columns-5 { grid-template-columns: repeat(4, 1fr); }
    .grid-columns-6 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 992px) {
    .grid-columns-4 { grid-template-columns: repeat(3, 1fr); }
    .grid-columns-5 { grid-template-columns: repeat(3, 1fr); }
    .grid-columns-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .grid-columns-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-columns-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-columns-5 { grid-template-columns: repeat(2, 1fr); }
    .grid-columns-6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .grid-columns-2 { grid-template-columns: 1fr; }
    .grid-columns-3 { grid-template-columns: 1fr; }
    .grid-columns-4 { grid-template-columns: 1fr; }
    .grid-columns-5 { grid-template-columns: 1fr; }
    .grid-columns-6 { grid-template-columns: 1fr; }
}

/* Стили для карточек */
.category-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    font-size: 14px;
    color: #666;
    flex-wrap: wrap;
}

.breadcrumb .sep {
    color: #ccc;
}

.breadcrumb a {
    color: #1976d2;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .current {
    font-weight: bold;
    color: #333;
}

.count-badge {
    display: inline-block;
    background: #e8ebee;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
    margin-left: 5px;
}

.result-count {
    margin: 15px 0 12px;
    color: #66717c;
}

.result-count .highlight {
    color: #1976d2;
    font-weight: bold;
}

.topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
    background: #3498db;
}

@media (max-width: 768px) {
    .topbar-actions {
        gap: 5px;
    }
    .topbar-actions .btn {
        font-size: 12px;
        padding: 6px 10px;
    }
}

.dropdown-submenu {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

.dropdown-submenu.open {
    max-height: 1000px;
}

.multi-photo-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    z-index: 5;
}

.photo-box {
    position: relative;
}

/* ============================================
   СТИЛИ ДЛЯ ПАГИНАЦИИ
   ============================================ */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 0;
    border-top: 1px solid #e8ebee;
    margin-top: 10px;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-controls .btn {
    padding: 6px 12px;
    font-size: 13px;
    min-width: 36px;
    text-align: center;
}

.pagination-controls .btn.active {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

.pagination-controls .btn.disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.pagination-controls .btn:hover:not(.disabled):not(.active) {
    background: #f0f7ff;
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.per-page-selector select {
    padding: 5px 10px;
    border: 1px solid #ccd3da;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.per-page-selector select:focus {
    border-color: #1976d2;
    outline: none;
}

/* ============================================
   СТИЛИ ДЛЯ ВЫБОРА КОЛОНОК
   ============================================ */
.columns-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.columns-selector .btn-group {
    display: flex;
    gap: 3px;
}

.columns-selector .btn-col {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #ccd3da;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    min-width: 30px;
    text-align: center;
}

.columns-selector .btn-col:hover {
    border-color: #1976d2;
    background: #f0f7ff;
}

.columns-selector .btn-col.active {
    background: #1976d2;
    border-color: #1976d2;
    color: white;
}

.columns-selector .btn-col .icon {
    font-size: 12px;
}

@media (max-width: 768px) {
    .pagination-wrapper {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .pagination-controls {
        justify-content: center;
    }
    .columns-selector {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 992px) {
    .main-layout {
        flex-direction: column;
    }
    .category-sidebar {
        width: 100%;
        position: static;
        max-height: 400px;
    }
    .search {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .category-sidebar-header {
        padding: 12px 15px;
    }
    .category-sidebar-header h3 {
        font-size: 14px;
    }
    .dropdown-link {
        padding: 6px 15px;
        font-size: 13px;
    }
    .search {
        grid-template-columns: 1fr;
    }
}

.topbar-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}
.logo {
    text-decoration: none;
    font-weight: 800;
    font-size: 22px;
}
.logo span {
    font-size: 11px;
    font-weight: normal;
    opacity: .7;
    margin-left: 0px;
}
.hero { padding: 35px 0 20px; }
.hero h1, main > h1 { margin-bottom: 8px; }
.hero p { color: #69737d; }
.btn {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: 10px 15px;
    background: #e5e9ed;
    color: #20252b;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
}
.btn:hover { opacity: .88; }
.btn.primary { background: #1976d2; color: white; }
.btn.danger { background: #d9534f; color: white; }
.search {
    display: grid;
    grid-template-columns: 1fr 220px auto auto;
    gap: 10px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 1px 5px rgba(0,0,0,.08);
}
input, select, textarea {
    width: 100%;
    border: 1px solid #ccd3da;
    border-radius: 7px;
    padding: 11px;
    font: inherit;
    background: white;
}
textarea { resize: vertical; }
.result-count { margin: 20px 0 12px; color: #66717c; }
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
    padding-bottom: 40px;
}
.card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.photo-box {
    height: 220px;
    display: block;
    background: #eef1f4;
    text-decoration: none;
}
.photo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.no-photo {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #89939d;
}
.no-photo.large { min-height: 280px; background: #eef1f4; }
.card-body { padding: 17px; line-height: 1.7; }
.card-body h2 { margin: 2px 0 8px; }
.card-body h2 a { text-decoration: none; }
.category {
    color: #1976d2;
    font-size: 13px;
    font-weight: bold;
}
.stock { margin-top: 8px; }
.empty {
    background: white;
    padding: 40px;
    text-align: center;
    border-radius: 12px;
}
.form {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0 40px;
}
.form label { display: block; margin: 16px 0; font-weight: bold; }
.form label input, .form label textarea, .form label select {
    margin-top: 7px;
    font-weight: normal;
}
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.char-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    margin: 8px 0;
}
.file-label {
    border: 2px dashed #ccd3da;
    padding: 20px !important;
    text-align: center;
    cursor: pointer;
}
.file-label input { margin-top: 10px !important; }
.hint { color: #737e88; font-size: 13px; }
.actions { display: flex; gap: 10px; margin-top: 25px; flex-wrap: wrap; }
.detail-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 30px 0 20px;
}
.detail-head h1 { margin: 5px 0; }
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    padding-bottom: 50px;
}
.detail-grid > section {
    background: white;
    padding: 20px;
    border-radius: 12px;
}
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.gallery a {
    display: block;
    background: #eef1f4;
    border-radius: 8px;
    overflow: hidden;
    min-height: 160px;
}
.gallery img {
    width: 100%;
    height: 200px;
    object-fit: contain;
}
.info > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #e8ebee;
}
.info span { color: #68737e; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px; border-bottom: 1px solid #e5e8eb; text-align: left; }
th { width: 40%; }
.description { line-height: 1.7; }
.photo-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}
.photo-item {
    background: #f1f3f5;
    padding: 10px;
    border-radius: 8px;
}
.photo-item img {
    width: 100%;
    height: 170px;
    object-fit: contain;
    display: block;
    margin-bottom: 8px;
}
@media (max-width: 800px) {
    .search, .detail-grid { grid-template-columns: 1fr; }
    .two { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .logo span { display: none; }
    .topbar-inner { padding: 10px 15px; }
    .char-row { grid-template-columns: 1fr; }
}


/* Добавить в конец файла style.css */

/* Управление местами хранения */
.location-selector {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.location-level {
    margin: 8px 0;
}

.location-level select {
    width: calc(100% - 50px);
    display: inline-block;
}

.location-level .btn.small {
    padding: 8px 12px;
    font-size: 16px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Индикатор низкого запаса */
.low-stock {
    color: #d9534f;
    font-weight: bold;
}

/* Модальные окна */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 1000;
    max-width: 500px;
    width: 90%;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* Адаптивность для управления местами */
@media (max-width: 600px) {
    .location-level select {
        width: 100%;
        margin-bottom: 5px;
    }
    .location-level .btn.small {
        margin-left: 0;
        width: 100%;
    }
}
.location-tree {
    margin: 20px 0;
}

.location-item {
    display: flex;
}
.category-select-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}
.category-select-wrapper select {
    flex: 1;
}
.category-select-wrapper .btn {
    white-space: nowrap;
}
.location-selector {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}
.location-level {
    margin: 8px 0;
}
.location-level select {
    width: calc(100% - 50px);
    display: inline-block;
}
.location-level .btn.small {
    padding: 8px 12px;
    font-size: 16px;
    margin-left: 8px;
    vertical-align: middle;
}

.photo-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 15px 0;
    min-height: 100px;
}

.photo-item {
    background: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    border: 2px solid #e8ebee;
    transition: border-color 0.3s;
}

.photo-item:hover {
    border-color: #1976d2;
}

.photo-item img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 4px;
    background: #f0f0f0;
}

.photo-item .photo-actions {
    display: flex;
    justify-content: center;
    margin-top: 8px;
    gap: 5px;
}

.photo-item .photo-actions .btn {
    flex: 1;
    padding: 4px 8px;
    font-size: 12px;
    text-align: center;
    cursor: pointer;
    border: none;
    border-radius: 4px;
}

.photo-item .photo-index {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #1976d2;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
}

.upload-area {
    border: 2px dashed #ccd3da;
    padding: 30px 20px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    margin: 10px 0;
}

.upload-area:hover {
    border-color: #1976d2;
    background: #f8f9fa;
}

.upload-area.dragover {
    border-color: #1976d2;
    background: #e8f0fe;
}

.upload-area input {
    display: none;
}

.sort-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #e8f0fe;
    border-radius: 6px;
    font-size: 13px;
    color: #1976d2;
    margin-bottom: 10px;
}

.empty-photos {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Стили для редактора */
.photo-editor-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.photo-editor-overlay.active {
    display: flex;
}

.photo-editor-modal {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.photo-editor-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8ebee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.photo-editor-header h3 {
    margin: 0;
    font-size: 18px;
}

.photo-editor-body {
    padding: 20px;
    overflow: auto;
    flex: 1;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.photo-editor-preview {
    flex: 1;
    min-width: 300px;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.photo-editor-preview img {
    max-width: 100%;
    display: block;
}

.photo-editor-controls {
    width: 280px;
    flex-shrink: 0;
}

.photo-editor-controls .control-group {
    margin-bottom: 15px;
}

.photo-editor-controls .control-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 5px;
    color: #333;
}

.photo-editor-controls .control-group input[type="range"] {
    width: 100%;
}

.photo-editor-controls .control-group .value {
    float: right;
    color: #666;
    font-size: 13px;
}

.photo-editor-controls .btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.photo-editor-controls .btn-group .btn {
    flex: 1;
    min-width: 60px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
}

.photo-editor-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e8ebee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Дополнительные стили для Bootstrap версии */

/* Стили для поиска */
.search {
    display: grid;
    grid-template-columns: 1fr 180px auto auto;
    gap: 10px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 1px 5px rgba(0,0,0,.08);
}

@media (max-width: 768px) {
    .search {
        grid-template-columns: 1fr;
    }
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    font-size: 14px;
    color: #666;
    flex-wrap: wrap;
    background: transparent;
}

.breadcrumb .sep {
    color: #ccc;
}

.breadcrumb a {
    color: #1976d2;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .current {
    font-weight: bold;
    color: #333;
}

/* Hero */
.hero {
    padding: 35px 0 20px;
}

.hero h1 {
    margin-bottom: 8px;
}

.hero p {
    color: #69737d;
}

/* Empty state */
.empty {
    background: white;
    padding: 40px;
    text-align: center;
    border-radius: 12px;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 0;
    border-top: 1px solid #e8ebee;
    margin-top: 10px;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-controls .btn {
    padding: 6px 12px;
    font-size: 13px;
    min-width: 36px;
    text-align: center;
}

.pagination-controls .btn.active {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

.pagination-controls .btn.disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.per-page-selector select {
    padding: 5px 10px;
    border: 1px solid #ccd3da;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.per-page-selector select:focus {
    border-color: #1976d2;
    outline: none;
}

/* Column selector */
.columns-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

@media (max-width: 768px) {
    .pagination-wrapper {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .pagination-controls {
        justify-content: center;
    }
    .columns-selector {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Стили для меню категорий */
.category-sidebar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 5px rgba(0,0,0,.08);
    overflow: hidden;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.category-sidebar-header {
    padding: 15px 18px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8ebee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.category-sidebar-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.category-sidebar-header .toggle-icon {
    font-size: 18px;
    transition: transform 0.3s;
    color: #666;
}

.category-sidebar-header .toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.category-sidebar-body {
    padding: 8px 0;
    overflow-y: auto;
    flex: 1;
}

.category-sidebar-body.collapsed {
    display: none;
}

.dropdown-item {
    position: relative;
}

.dropdown-link {
    display: flex;
    align-items: center;
    padding: 8px 18px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    gap: 4px;
}

.dropdown-link:hover {
    background: #f0f7ff;
    border-left-color: #1976d2;
}

.dropdown-link .icon {
    margin-right: 4px;
    font-size: 16px;
}

.dropdown-link .arrow {
    margin-left: auto;
    font-size: 12px;
    color: #999;
    transition: transform 0.2s;
}

.dropdown-link.active {
    background: #e8f0fe;
    border-left-color: #1976d2;
    font-weight: 600;
    color: #1976d2;
}

.dropdown-link .count {
    font-size: 11px;
    color: #666;
    margin-left: auto;
    background: #e8ebee;
    padding: 0 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.dropdown-link.active .count {
    background: #1976d2;
    color: white;
}

.dropdown-submenu {
    display: none;
    background: #fafafa;
}

.dropdown-submenu.open {
    display: block;
}

.dropdown-submenu .dropdown-link {
    padding-left: 38px !important;
    font-size: 13px;
}

.dropdown-submenu .dropdown-submenu .dropdown-link {
    padding-left: 58px !important;
    font-size: 12px;
}

.dropdown-submenu .dropdown-submenu .dropdown-submenu .dropdown-link {
    padding-left: 78px !important;
    font-size: 11px;
}

.dropdown-submenu {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

.dropdown-submenu.open {
    max-height: 1000px;
}

@media (max-width: 992px) {
    .category-sidebar {
        position: static;
        max-height: 400px;
    }
}