﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: linear-gradient(135deg, #2c5a94 0%, #1a3a5c 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
}

.search-section {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-bar-wrapper {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
} 

.search-title {
    font-size: 0.875rem;
    color: #333;
    font-weight: 600;
}

.search-input {
    padding: 0.5rem 0.75rem;
    background: #f3f3f3;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    color: #333;
    font-size: 0.875rem;
}

.search-input::placeholder {
    color: #888;
}

.search-input:focus {
    outline: none;
    border-color: #ff9f43;
    background: rgba(0, 0, 0, 0.1);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.action-btn {
    width: 32px;
    height: 32px;
    background: linear-gradient(180deg, #ff9f43, #ff7a18);
    border: none;
    border-radius: 0.25rem;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.action-btn:hover {
    background: linear-gradient(180deg, #ffa94d, #ff851b);
    transform: translateY(-2px);
}

.action-btn-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: #ff9f43;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.action-btn-close:hover {
    color: #ff7a18;
}

.catalogue-container {
    display: flex;
    flex: 1;
    gap: 1rem;
    padding: 1rem 1.5rem;
    overflow: hidden;
}

.right-panel-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.right-main-panel {
    background: linear-gradient(180deg, #1b3f6b, #132f52);
    border: 2px solid #0d2a45;
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.top-white-bar {
    background: #ffffff;
    padding: 1rem;
    border-bottom: 2px solid #0d2a45;
    margin: 0;
    box-shadow: none;
}

.bottom-panels-side-by-side {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.bottom-panels-side-by-side::after {
    content: '';
    position: absolute;
    left: 280px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #0d2a45, #1b3f6b);
    z-index: 1;
}

.families-panel {
    background: linear-gradient(180deg, #1b3f6b, #132f52);
    border: 2px solid #0d2a45;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    width: 260px;
    flex-shrink: 0;
    overflow: hidden;
}

.subfamilies-panel,
.items-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.subfamilies-panel {
    width: 280px;
    flex-shrink: 0;
}

.items-panel {
    flex: 1;
    min-width: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 159, 67, 0.1);
}

.panel-header h2 {
    margin: 0;
    color: #ff9f43;
    font-weight: 600;
    font-size: 1rem;
}

.action-icons {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    width: 28px;
    height: 28px;
    background: linear-gradient(180deg, #ff9f43, #ff7a18);
    border: none;
    border-radius: 0.25rem;
    color: #fff;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.icon-btn:hover {
    background: linear-gradient(180deg, #ffa94d, #ff851b);
    transform: translateY(-2px);
}

.families-list,
.subfamilies-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.family-row,
.subfamily-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, #2c5c94, #1b3f6b);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
}

.family-row:hover,
.subfamily-row:hover,
.family-row.active,
.subfamily-row.active {
    background: linear-gradient(180deg, #ff9f43, #ff7a18);
}

.family-name,
.subfamily-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.875rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.family-icon,
.subfamily-icon {
    flex-shrink: 0;
    font-size: 1.8rem;
    color: #fff;
}

.default-icon {
    font-size: 1.8rem;
    color: #fff;
}

.family-row::after,
.subfamily-row::after {
    content: '>';
    position: absolute;
    right: 1rem;
    color: #fff;
    font-size: 1.4rem;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.family-row:hover::after,
.subfamily-row:hover::after,
.family-row.active::after,
.subfamily-row.active::after {
    opacity: 1;
}

.family-row.active .family-name,
.subfamily-row.active .subfamily-name {
    color: #fff;
}

.family-actions,
.subfamily-actions {
    display: none !important;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.item-card {
    background: linear-gradient(180deg, #355f8f, #1e416b);
    border-radius: 1rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 8px 20px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    position: relative;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 12px 25px rgba(0, 0, 0, 0.5);
}

.item-image-wrapper {
    width: 100%;
    height: 100px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-image-placeholder {
    font-size: 2.5rem;
}

.item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.item-price-badge {
    background: linear-gradient(180deg, #ff9f43, #ff7a18);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.badge-label {
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
}

.item-name {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-details {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.item-detail-badge {
    background: rgba(255, 159, 67, 0.2);
    border: 1px solid rgba(255, 159, 67, 0.5);
    color: #ff9f43;
    font-size: 0.65rem;
    padding: 0.15rem 0.3rem;
    border-radius: 0.2rem;
    white-space: nowrap;
}

.item-actions {
    display: flex;
    gap: 0.25rem;
    margin-top: auto;
}

.item-action-btn {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(255, 159, 67, 0.3);
    color: #ff9f43;
    padding: 0.3rem;
    border-radius: 0.2rem;
    cursor: pointer;
    font-size: 0.65rem;
    transition: all 0.15s ease;
}

.item-action-btn:hover {
    background: rgba(255, 159, 67, 0.2);
    border-color: #ff9f43;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.empty-state p {
    margin: 0;
}

@media (max-width: 1400px) {
    .catalogue-container {
        gap: 0.75rem;
        padding: 1rem;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 1024px) {
    .catalogue-container {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .families-panel {
        width: 100%;
    }

    .bottom-panels-side-by-side {
        flex-direction: column;
    }

    .bottom-panels-side-by-side::after {
        display: none;
    }

    .subfamilies-panel {
        width: 100%;
        height: 300px;
    }

    .items-panel {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .catalogue-container {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }

    .item-card {
        padding: 0.5rem;
    }

    .item-image-wrapper {
        height: 80px;
    }

    .action-buttons {
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .items-grid {
        grid-template-columns: 1fr;
    }

    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
    }

    .item-name {
        font-size: 0.7rem;
    }
}

button {
    outline: none;
    font-family: inherit;
}

button:active {
    transform: scale(0.98);
}

input[type="text"],
input[type="number"],
select,
textarea {
    font-family: inherit;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    display: none;
}

tr, td {
    border: none !important;
}

td {
    padding: 0;
}

.catalogue-container {
    display: flex;
    flex: 1;
    gap: 1.5rem;
    padding: 1.5rem;
    overflow: hidden;
}

.right-main-panel {
    background: linear-gradient(180deg, #1b3f6b, #132f52);
    border: 3px solid #0d2a45;
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.top-white-bar {
    background: #ffffff;
    padding: 1.2rem;
    border-bottom: 3px solid #0d2a45;
    margin: 0;
    box-shadow: none;
}

.bottom-panels-side-by-side {
    display: flex;
    flex: 1;
    gap: 1.5rem;
    overflow: hidden;
    position: relative;
    padding: 1rem;
}

.bottom-panels-side-by-side::after {
    width: 3px;
    background: #0d2a45;
    box-shadow: 0 0 10px rgba(13, 42, 69, 0.6);
}

.families-panel {
    border: 3px solid #0d2a45;
    border-radius: 1rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.families-panel,
.right-main-panel,
.top-white-bar,
.bottom-panels-side-by-side::after {
    border: none !important;
}

.families-panel {
    background: linear-gradient(180deg, #1b3f6b, #132f52);
    border-radius: 1.2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.right-main-panel {
    background: linear-gradient(180deg, #1b3f6b, #132f52);
    border-radius: 1.2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.top-white-bar {
    background: #ffffff;
    padding: 1.2rem;
    margin: 0;
}

.catalogue-container {
    gap: 2.5rem;
    padding: 2rem;
}

.bottom-panels-side-by-side {
    gap: 2.5rem;
    padding: 1.5rem;
}

.bottom-panels-side-by-side::after {
    width: 1px;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
}

.subfamilies-panel,
.items-panel {
    background: transparent;
    border: none;
    box-shadow: none;
}

.family-icon,
.subfamily-icon,
.default-icon {
    color: #fff !important;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.family-name,
.subfamily-name {
    color: #fff !important;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.family-img,
.subfamily-img,
.default-icon {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.list-icon {
    font-size: 1.4rem;
    color: #ffffff;
    opacity: 0.9;
}

.families-list table,
.subfamilies-list table {
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.families-list table tr,
.subfamilies-list table tr {
    display: block;
    margin-bottom: 0.6rem;
}

.families-list table tr:last-child,
.subfamilies-list table tr:last-child {
    margin-bottom: 0;
}


.family-row,
.subfamily-row {
    padding: 0.45rem 0.75rem;
    gap: 0.6rem;
    min-height: 38px;
}

.family-name,
.subfamily-name {
    font-size: 0.82rem;
    line-height: 1;
}

.list-icon {
    font-size: 1.2rem;
    color: #ffffff;
    opacity: 0.9;
    flex-shrink: 0;
    line-height: 1;
}

.family-row,
.subfamily-row {
    display: flex;
    align-items: center;
}

.family-row td,
.subfamily-row td {
     display: flex;
     align-items: center;
     padding: 0;
}

.family-icon,
.subfamily-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    margin-right: 0.6rem;
}

.family-name,
.subfamily-name {
    display: flex;
    align-items: center;
}

.bottom-panels-side-by-side {
    border: 4px solid #ffffff;
    border-radius: 1.2rem;
    background: linear-gradient(180deg, #1b3f6b, #132f52);
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    position: relative;
    overflow: hidden;
    gap: 2.5rem;
}

.bottom-panels-side-by-side::after {
    content: '';
    position: absolute;
    left: calc(280px + 1.5rem);
    top: 1.5rem;
    bottom: 1.5rem;
    width: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
    z-index: 1;
}

.subfamilies-panel, .items-panel {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.bottom-panels-side-by-side {
    border: 6px solid #ffffff; 
    border-radius: 1.2rem; 
    background: linear-gradient(180deg, #1b3f6b, #132f52);
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    position: relative;
    overflow: hidden;
    gap: 2.5rem;
    height: auto; 
}

.bottom-panels-side-by-side::after {
    content: '';
    position: absolute;
    left: calc(280px + 1.5rem);
    top: 1.5rem;
    bottom: 1.5rem;
    width: 2px;
    background: rgba(255, 255, 255, 0.35);
    z-index: 1;
}

.subfamilies-list {
    overflow-y: auto; 
    max-height: 100%; 
}

.items-grid {
    display: flex !important; 
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 1rem;
}

.item-card {
    min-width: 160px; 
}

.top-white-bar {
    padding-bottom: 0.5rem; 
}

.scroll-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.sub-scroll-buttons, .item-scroll-buttons {
    display: flex;
    gap: 0.5rem;
}

.scroll-btn {
    width: 32px;
    height: 32px;
    background: linear-gradient(180deg, #ff9f43, #ff7a18);
    border: none;
    border-radius: 50%; 
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 5px rgba(0,0,0,0.3);
}

.scroll-btn:hover {
    background: linear-gradient(180deg, #ffa94d, #ff851b);
    transform: translateY(-2px);
}

.bottom-activity-panel {
    background: linear-gradient(180deg, #1b3f6b, #132f52);
    border: 3px solid #0d2a45;
    border-radius: 1.2rem;
    padding: 1.5rem;
    margin-top: 2rem; 
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.bottom-search-bar {
    background: #ffffff;
    padding: 1rem 1.2rem;
    border-radius: 0.8rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.bottom-search-bar input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.bottom-search-bar .search-icon {
    color: #ff9f43;
    font-size: 1.2rem;
}

.activity-sections {
    display: flex;
    gap: 2rem;
    flex: 1;
}

.activity-section {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 1rem;
    backdrop-filter: blur(5px);
}

.activity-section h3 {
    color: #ff9f43;
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.8rem 1rem;
    border-radius: 0.7rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: rgba(255, 159, 67, 0.15);
    transform: translateX(5px);
}

.activity-item .item-name {
    font-weight: 600;
    color: #fff;
}

.activity-item .item-price {
    color: #ff9f43;
    font-weight: bold;
}

.empty-activity {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}