@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
    --background: #f7f8fc;
    --surface: #ffffff;
    --primary: #7158ff;
    --primary-dark: #5d43ee;
    --primary-light: #f0edff;
    --text: #25283b;
    --muted: #85899e;
    --border: #ececf3;
    --sidebar-width: 110px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-width: 320px;
    min-height: 100vh;
    overflow-x: hidden;

    color: var(--text);
    background: var(--background);

    font-family: "Inter", Arial, sans-serif;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.app {
    min-height: 100vh;
}

/* ================= Боковое меню ================= */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;

    width: var(--sidebar-width);
    height: 100vh;

    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 24px 12px 22px;

    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: 5px 0 30px rgba(38, 34, 77, 0.04);
}

.sidebar-logo {
    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 38px;

    color: #ffffff;
    background: linear-gradient(145deg, #8068ff, #6649f6);
    border-radius: 13px;
    box-shadow: 0 9px 20px rgba(113, 88, 255, 0.28);
}

.sidebar-logo svg {
    width: 23px;
    height: 23px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-menu {
    width: 100%;

    display: flex;
    flex-direction: column;
    gap: 16px;
}

.menu-item {
    position: relative;

    width: 100%;
    min-height: 78px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 10px 5px;

    color: #72788f;
    text-decoration: none;
    border-radius: 15px;

    transition: 0.2s ease;
}

.menu-item svg {
    width: 24px;
    height: 24px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.menu-item span {
    font-size: 11px;
    font-weight: 500;
    line-height: 15px;
    text-align: center;
}

.menu-item:hover {
    color: var(--primary);
    background: #f7f5ff;
    transform: translateY(-1px);
}

.menu-item.active {
    color: var(--primary);
    background: var(--primary-light);
}

.menu-item.active::before {
    content: "";

    position: absolute;
    top: 18px;
    bottom: 18px;
    left: -12px;

    width: 3px;

    background: var(--primary);
    border-radius: 0 6px 6px 0;
}

.logout-button {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    margin-top: auto;
    padding: 12px 5px;

    color: #7c8195;
    background: transparent;
    border: none;
    border-radius: 12px;

    font-size: 11px;
    cursor: pointer;
    transition: 0.2s ease;
}

.logout-button svg {
    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.logout-button:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* ================= Основная страница ================= */

.content {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding: 34px 38px 40px;
}

.catalog-content {
    max-width: 1750px;
}

.catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 25px;
}

.page-label {
    margin-bottom: 6px;

    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.catalog-header h1 {
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: -0.6px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.primary-button,
.secondary-button {
    min-height: 44px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 0 17px;

    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;

    transition: 0.2s ease;
}

.primary-button {
    color: #ffffff;
    background: var(--primary);
    border: 1px solid var(--primary);

    box-shadow: 0 8px 20px rgba(113, 88, 255, 0.2);
}

.primary-button span {
    font-size: 20px;
    line-height: 1;
}

.primary-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.secondary-button {
    color: var(--primary);
    background: var(--surface);
    border: 1px solid var(--border);
}

.secondary-button svg {
    width: 17px;
    height: 17px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.secondary-button:hover {
    background: var(--primary-light);
}

/* ================= Статистика ================= */

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(175px, 1fr));
    gap: 14px;

    margin-bottom: 20px;
}

.statistics-card {
    min-height: 108px;

    display: flex;
    align-items: center;
    gap: 14px;

    padding: 18px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 17px;
    box-shadow: 0 8px 25px rgba(38, 34, 77, 0.035);
}

.statistics-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;
}

.statistics-icon svg {
    width: 21px;
    height: 21px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.statistics-icon.purple {
    color: #7057ff;
    background: #f1eeff;
}

.statistics-icon.green {
    color: #30a978;
    background: #e9f8f1;
}

.statistics-icon.blue {
    color: #5d73ff;
    background: #eef0ff;
}

.statistics-icon.emerald {
    color: #159b68;
    background: #e8f8f1;
}

.statistics-icon.orange {
    color: #e58a28;
    background: #fff3e5;
}

.statistics-card p {
    margin-bottom: 4px;

    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.statistics-card strong {
    display: block;
    margin-bottom: 4px;

    color: var(--text);
    font-size: 17px;
    line-height: 1.2;
}

.statistics-card span {
    color: #979bad;
    font-size: 10px;
}

/* ================= Поиск и фильтры ================= */

.catalog-toolbar {
    display: grid;
    grid-template-columns: minmax(270px, 1.8fr) 0.85fr 0.85fr 1.2fr;
    gap: 10px;

    margin-bottom: 14px;
}

.search-field {
    height: 46px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 0 15px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.search-field:focus-within {
    border-color: #bcb2ff;
    box-shadow: 0 0 0 3px rgba(113, 88, 255, 0.08);
}

.search-field svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;

    fill: none;
    stroke: #9498aa;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.search-field input {
    width: 100%;

    color: var(--text);
    background: transparent;
    border: none;
    outline: none;

    font-size: 12px;
}

.search-field input::placeholder {
    color: #a5a8b7;
}

.filter-select {
    height: 46px;
    padding: 0 36px 0 14px;

    color: #555a70;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;

    font-size: 11px;
    cursor: pointer;
}

.filter-select:focus {
    border-color: #bcb2ff;
}

/* ================= Таблица ================= */

.products-table-card {
    overflow: hidden;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 17px;
    box-shadow: 0 10px 30px rgba(38, 34, 77, 0.035);
}

.products-table-wrapper {
    overflow-x: auto;
}

.products-table {
    width: 100%;
    min-width: 1250px;

    border-collapse: collapse;
}

.products-table th {
    height: 48px;
    padding: 0 13px;

    color: #9397a8;
    background: #fdfdff;
    border-bottom: 1px solid var(--border);

    font-size: 9px;
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.products-table td {
    height: 68px;
    padding: 8px 13px;

    color: #44495e;
    border-bottom: 1px solid #f0f0f5;

    font-size: 11px;
    white-space: nowrap;
}

.products-table tbody tr {
    transition: background-color 0.2s ease;
}

.products-table tbody tr:hover {
    background: #faf9ff;
}

.products-table tbody tr:last-child td {
    border-bottom: none;
}

.product-info {
    min-width: 250px;

    display: flex;
    align-items: center;
    gap: 12px;
}

.product-image {
    width: 42px;
    height: 42px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;
    font-size: 22px;
}

.product-red {
    background: #fff0f0;
}

.product-yellow {
    background: #fff8e8;
}

.product-purple {
    background: #f4efff;
}

.product-blue {
    background: #edf7ff;
}

.product-brown {
    background: #f7f0e9;
}

.product-light-blue {
    background: #edf6ff;
}

.product-green {
    background: #edf8f0;
}

.product-info strong {
    display: block;
    margin-bottom: 5px;

    color: #303448;
    font-size: 12px;
    font-weight: 600;
}

.product-info span {
    display: block;

    color: #9296a8;
    font-size: 9.5px;
}

.product-info .expiry-warning {
    color: #e8783d;
}

.category-badge {
    display: inline-flex;
    padding: 5px 8px;

    border-radius: 7px;
    font-size: 9px;
    font-weight: 500;
}

.category-badge.drinks {
    color: #3979dc;
    background: #edf4ff;
}

.category-badge.snacks {
    color: #e57934;
    background: #fff2e8;
}

.category-badge.sweets {
    color: #8457d9;
    background: #f4edff;
}

.category-badge.bakery {
    color: #c98724;
    background: #fff5df;
}

.category-badge.dairy {
    color: #27936d;
    background: #e9f7f1;
}

.category-badge.tea {
    color: #a66a27;
    background: #fff2e5;
}

.stock-status,
.profit-value {
    font-weight: 600;
}

.stock-status.good {
    color: #24a873;
}

.stock-status.warning {
    color: #e4902d;
}

.stock-status.danger {
    color: #ef5b61;
}

.profit-value {
    color: #25a16f;
}

.more-button {
    width: 31px;
    height: 31px;

    color: #6f7488;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;

    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    transition: 0.2s ease;
}

.more-button:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* ================= Нижняя часть таблицы ================= */

.table-footer {
    min-height: 62px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 12px 16px;

    border-top: 1px solid var(--border);
}

.table-footer > span {
    color: #989cad;
    font-size: 10px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 7px;
}

.pagination button {
    min-width: 35px;
    height: 35px;
    padding: 0 11px;

    color: #666b7e;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 9px;

    font-size: 10px;
    cursor: pointer;
    transition: 0.2s ease;
}

.pagination button:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.pagination button.active {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

.pagination span {
    color: #8f93a5;
    font-size: 11px;
}

/* ================= Адаптивность ================= */

@media (max-width: 1450px) {
    .statistics-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .catalog-toolbar {
        grid-template-columns: 1.5fr 1fr 1fr;
    }

    .sorting-select {
        grid-column: span 3;
    }
}

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

    .catalog-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .search-field,
    .sorting-select {
        grid-column: span 2;
    }
}

@media (max-width: 700px) {
    :root {
        --sidebar-width: 84px;
    }

    .sidebar {
        padding-left: 8px;
        padding-right: 8px;
    }

    .menu-item.active::before {
        left: -8px;
    }

    .content {
        padding: 25px 16px;
    }

    .catalog-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
    }

    .primary-button,
    .secondary-button {
        flex: 1;
    }

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

    .catalog-toolbar {
        grid-template-columns: 1fr;
    }

    .search-field,
    .sorting-select {
        grid-column: auto;
    }

    .table-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}
































/* ================= Добавление товара ================= */

.add-product-content {
    max-width: 1500px;
}

.add-product-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 28px;
}

.add-product-header h1 {
    margin-bottom: 7px;

    font-size: 29px;
    letter-spacing: -0.7px;
}

.add-product-header p {
    color: var(--muted);
    font-size: 13px;
}

.save-product-button {
    min-height: 46px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    padding: 0 18px;

    color: #ffffff;
    background: var(--primary);
    border: none;
    border-radius: 12px;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
    box-shadow: 0 9px 22px rgba(113, 88, 255, 0.23);
    transition: 0.2s ease;
}

.save-product-button svg {
    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.save-product-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.add-product-card {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
    gap: 46px;

    padding: 34px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 19px;
    box-shadow: 0 10px 32px rgba(38, 34, 77, 0.045);
}

.product-form-column {
    min-width: 0;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 9px;

    color: #34384c;
    font-size: 12px;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    height: 47px;

    padding: 0 14px;

    color: var(--text);
    background: #ffffff;
    border: 1px solid #dedfe8;
    border-radius: 10px;
    outline: none;

    font-size: 12px;
    transition: 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #b7adff;
    box-shadow: 0 0 0 3px rgba(113, 88, 255, 0.08);
}

.form-group input::placeholder {
    color: #a6a9b7;
}

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

.input-with-suffix {
    position: relative;
}

.input-with-suffix input {
    padding-right: 52px;
}

.input-with-suffix span {
    position: absolute;
    top: 50%;
    right: 15px;

    color: #7d8295;
    font-size: 11px;
    font-weight: 600;

    transform: translateY(-50%);
    pointer-events: none;
}

.image-upload {
    min-height: 190px;

    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 26px;

    color: #555b70;
    background: #fdfdff;
    border: 1px dashed #cfd1dd;
    border-radius: 13px;

    text-align: center;
    cursor: pointer;
    transition: 0.2s ease;
}

.image-upload:hover {
    border-color: var(--primary);
    background: #faf9ff;
}

.image-upload svg {
    width: 28px;
    height: 28px;

    margin-bottom: 13px;

    fill: none;
    stroke: var(--primary);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.image-upload strong {
    margin-bottom: 5px;

    color: #3a3e51;
    font-size: 12px;
}

.image-upload span {
    color: #8f93a3;
    font-size: 10px;
}

.choose-file-button {
    margin-top: 16px;
    padding: 10px 15px;

    color: #5f6478;
    background: #ffffff;
    border: 1px solid #dddfe8;
    border-radius: 9px;

    font-size: 11px;
    font-weight: 500;
}

.preview-column h2 {
    margin-bottom: 18px;

    font-size: 14px;
    font-weight: 600;
}

.product-preview-card {
    padding: 20px;

    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(42, 38, 78, 0.055);

    text-align: center;
}

.preview-image {
    width: 100%;
    height: 195px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 18px;

    overflow: hidden;

    color: #a2a6b5;
    background: #f1f1f5;
    border-radius: 12px;
}

.preview-image svg {
    width: 44px;
    height: 44px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.product-preview-card h3 {
    margin-bottom: 14px;

    color: #292d40;
    font-size: 19px;
}

.product-preview-card p {
    margin-bottom: 9px;

    color: #767b90;
    font-size: 12px;
}

.product-preview-card p strong {
    color: #35394e;
    font-weight: 600;
}

.product-preview-card .preview-profit strong {
    color: #21a66f;
}

.product-preview-card .preview-profit strong.negative-profit {
    color: #ef5a62;
}

.product-preview-card .preview-expiry {
    margin-top: 13px;
    padding-top: 13px;

    border-top: 1px solid #eeeeF4;
}

.product-form-note {
    grid-column: 1 / -1;

    display: flex;
    align-items: center;
    gap: 13px;

    padding: 16px 18px;

    background: #f6f4ff;
    border-radius: 13px;
}

.note-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--primary);
    background: #e8e3ff;
    border-radius: 10px;
}

.note-icon svg {
    width: 20px;
    height: 20px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.product-form-note strong {
    display: block;
    margin-bottom: 4px;

    color: #4d5165;
    font-size: 11px;
}

.product-form-note span {
    color: #84889c;
    font-size: 10px;
}

@media (max-width: 1050px) {
    .add-product-card {
        grid-template-columns: 1fr;
    }

    .preview-column {
        max-width: 420px;
    }
}

@media (max-width: 700px) {
    .add-product-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .save-product-button {
        width: 100%;
    }

    .add-product-card {
        padding: 22px;
        gap: 28px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ================= Центрирование формы ================= */

.add-product-content {
    max-width: none;
}

.add-product-header,
.add-product-card {
    width: min(1180px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.add-product-header {
    margin-bottom: 28px;
}

.add-product-card {
    grid-template-columns: minmax(0, 1fr) 350px;
}

/* ================= Поле срока годности ================= */

.expiry-input-wrapper {
    position: relative;
}

.expiry-input-wrapper input {
    padding-right: 48px;
}

.expiry-input-wrapper svg {
    position: absolute;
    top: 50%;
    right: 15px;

    width: 19px;
    height: 19px;

    fill: none;
    stroke: #8e92a4;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;

    transform: translateY(-50%);
    pointer-events: none;
}

.form-group input.input-error {
    border-color: #ef5a62;
    box-shadow: 0 0 0 3px rgba(239, 90, 98, 0.09);
}

/* ================= Красивый выбор категории ================= */

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-button {
    width: 100%;
    height: 47px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 14px;

    color: #8f93a5;
    background: #ffffff;
    border: 1px solid #dedfe8;
    border-radius: 10px;

    font-size: 12px;
    text-align: left;
    cursor: pointer;

    transition: 0.2s ease;
}

.custom-select-button svg {
    width: 18px;
    height: 18px;

    fill: none;
    stroke: #8d91a2;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;

    transition: transform 0.2s ease;
}

.custom-select.open .custom-select-button {
    border-color: #b7adff;
    box-shadow: 0 0 0 3px rgba(113, 88, 255, 0.08);
}

.custom-select.open .custom-select-button svg {
    transform: rotate(180deg);
}

.custom-select-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 50;

    width: 100%;
    max-height: 280px;
    overflow-y: auto;

    padding: 7px;

    visibility: hidden;
    opacity: 0;
    transform: translateY(-7px);

    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: 0 15px 40px rgba(43, 37, 79, 0.13);

    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0.18s ease;
}

.custom-select.open .custom-select-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.custom-select-menu button {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 11px 12px;

    color: #4e5266;
    background: transparent;
    border: none;
    border-radius: 9px;

    font-size: 12px;
    text-align: left;
    cursor: pointer;

    transition: 0.15s ease;
}

.custom-select-menu button:hover,
.custom-select-menu button.selected {
    color: var(--primary);
    background: var(--primary-light);
}

.category-dot {
    width: 9px;
    height: 9px;
    flex-shrink: 0;

    border-radius: 50%;
}

.drinks-dot {
    background: #5295ed;
}

.snacks-dot {
    background: #ef924d;
}

.sweets-dot {
    background: #9a72e6;
}

.bakery-dot {
    background: #dca044;
}

.dairy-dot {
    background: #46b98d;
}

.tea-dot {
    background: #a97845;
}

.other-dot {
    background: #979bad;
}

/* ================= Квадратная картинка ================= */

.preview-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;

    background: #f4f4f7;
}

/* ================= Адаптивность ================= */

@media (max-width: 1050px) {
    .add-product-card {
        grid-template-columns: 1fr;
    }

    .preview-column {
        width: min(380px, 100%);
        margin: 0 auto;
    }
}

/* ================= Финальные настройки страницы добавления товара ================= */

.add-product-header,
.add-product-card {
    width: min(1280px, 100%);
}

.add-product-card {
    grid-template-columns: minmax(0, 1.55fr) minmax(340px, 420px);
    gap: 40px;
    align-items: start;
}

.preview-column {
    position: sticky;
    top: 28px;
    align-self: start;
    width: 100%;
    max-width: none;
    margin: 0;
}

.product-preview-card {
    padding: 24px;
    border-radius: 18px;
}

.preview-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f4f4f7;
}

@media (max-width: 1050px) and (min-width: 851px) {
    .add-product-card {
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 26px;
    }

    .preview-column {
        position: sticky;
        top: 20px;
        width: 100%;
        max-width: none;
        margin: 0;
    }
}

@media (max-width: 850px) {
    .add-product-card {
        grid-template-columns: 1fr;
    }

    .preview-column {
        position: static;
        width: min(420px, 100%);
        margin: 0 auto;
    }
}


/* ================= Динамический каталог ================= */

.product-image-uploaded {
    overflow: hidden;
    background: #f4f4f8;
}

.product-image-uploaded img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.empty-catalog {
    min-height: 280px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;

    padding: 40px;
    text-align: center;
}

.empty-catalog strong {
    color: var(--text);
    font-size: 17px;
}

.empty-catalog > span {
    margin-bottom: 9px;
    color: var(--muted);
    font-size: 12px;
}


/* ================= Касса ================= */

.cashier-content {
    max-width: 1800px;
    padding-bottom: 24px;
}

.cashier-page-header {
    margin-bottom: 20px;
}

.cashier-page-header h1 {
    margin-bottom: 5px;
    font-size: 28px;
    letter-spacing: -0.6px;
}

.cashier-page-header p {
    color: var(--muted);
    font-size: 12px;
}

.cashier-layout {
    min-height: calc(100vh - 135px);
    display: grid;
    grid-template-columns: minmax(0, 1.22fr) minmax(430px, 0.78fr);
    gap: 16px;
}

.cashier-products-panel,
.cashier-check-panel {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(38, 34, 77, 0.04);
}

.cashier-products-panel {
    padding: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cashier-search {
    height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid #dedfe8;
    border-radius: 11px;
}

.cashier-search:focus-within {
    border-color: #b7adff;
    box-shadow: 0 0 0 3px rgba(113, 88, 255, 0.08);
}

.cashier-search svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: none;
    stroke: #9296a8;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.cashier-search input {
    width: 100%;
    border: none;
    outline: none;
    color: var(--text);
    background: transparent;
    font-size: 12px;
}

.cashier-category-tabs {
    display: flex;
    gap: 8px;
    margin: 14px 0;
    padding-bottom: 3px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.cashier-category-tab {
    min-height: 35px;
    flex: 0 0 auto;
    padding: 0 13px;
    color: #666b7e;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: .18s ease;
}

.cashier-category-tab:hover,
.cashier-category-tab.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.cashier-products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding-right: 3px;
    overflow-y: auto;
    align-content: start;
}

.cashier-product-card {
    min-width: 0;
    padding: 10px;
    color: inherit;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 13px;
    text-align: left;
    cursor: pointer;
    transition: .18s ease;
}

.cashier-product-card:hover {
    border-color: #bdb3ff;
    transform: translateY(-1px);
    box-shadow: 0 9px 24px rgba(66, 54, 125, .09);
}

.cashier-product-card:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.cashier-product-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
    color: #9b9faf;
    background: #f5f5f8;
    border-radius: 10px;
    font-size: 34px;
}

.cashier-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cashier-product-card strong,
.cashier-product-card span {
    display: block;
}

.cashier-product-card strong {
    min-height: 31px;
    margin-bottom: 5px;
    overflow: hidden;
    color: #32364a;
    font-size: 11px;
    line-height: 1.4;
}

.cashier-product-card .cashier-card-price {
    color: #292d40;
    font-size: 13px;
    font-weight: 700;
}

.cashier-product-card .cashier-card-stock {
    margin-top: 4px;
    color: #9397a8;
    font-size: 9px;
}

.cashier-empty-products {
    grid-column: 1 / -1;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    text-align: center;
}

.cashier-empty-products strong { color: var(--text); font-size: 15px; }
.cashier-empty-products span { font-size: 11px; }

.cashier-check-panel {
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.check-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 17px;
}

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

.check-title-wrap h2 { font-size: 17px; }
.check-title-wrap span {
    padding: 4px 8px;
    color: #7b8094;
    background: #f1f1f5;
    border-radius: 7px;
    font-size: 9px;
    font-weight: 600;
}

.clear-check-button {
    min-height: 35px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    color: #e24e58;
    background: #fff;
    border: 1px solid #ffd9dc;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
}

.clear-check-button:disabled { opacity: .45; cursor: not-allowed; }
.clear-check-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.check-table-head,
.check-item-row {
    display: grid;
    grid-template-columns: minmax(145px, 1.4fr) 90px 69px 76px 30px;
    gap: 9px;
    align-items: center;
}

.check-table-head {
    padding: 0 5px 10px;
    color: #9296a8;
    border-bottom: 1px solid var(--border);
    font-size: 9px;
}

.check-items {
    min-height: 180px;
    max-height: calc(100vh - 480px);
    overflow-y: auto;
}

.check-item-row {
    min-height: 64px;
    padding: 8px 5px;
    border-bottom: 1px solid #f0f0f5;
}

.check-item-product {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

.check-item-image {
    width: 34px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f4f4f7;
    border-radius: 7px;
    font-size: 18px;
}

.check-item-image img { width: 100%; height: 100%; object-fit: contain; }
.check-item-product strong { overflow: hidden; color: #35394d; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.quantity-control {
    height: 34px;
    display: grid;
    grid-template-columns: 28px 1fr 28px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.quantity-control button {
    height: 100%;
    color: #757a8e;
    background: transparent;
    border: none;
    cursor: pointer;
}

.quantity-control span { text-align: center; font-size: 10px; font-weight: 600; }
.check-item-price, .check-item-total { color: #3f4357; font-size: 10px; font-weight: 600; }

.remove-check-item {
    width: 29px;
    height: 29px;
    color: #8c90a1;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.empty-check {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--muted);
    text-align: center;
}

.empty-check strong { color: var(--text); font-size: 14px; }
.empty-check span { font-size: 10px; }

.check-summary {
    display: grid;
    grid-template-columns: minmax(170px, .9fr) minmax(200px, 1.1fr);
    gap: 18px;
    margin-top: auto;
    padding: 15px;
    background: #faf9ff;
    border: 1px solid #f0eef9;
    border-radius: 13px;
}

.deduction-field > span {
    display: block;
    margin-bottom: 8px;
    color: #777c90;
    font-size: 10px;
}

.deduction-field > div {
    height: 42px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 9px;
}

.deduction-field input { width: 100%; border: none; outline: none; color: var(--text); font-size: 11px; }
.deduction-field b { color: #808498; font-size: 9px; }

.summary-values p,
.summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.summary-values p { margin-bottom: 10px; color: #777c90; font-size: 10px; }
.summary-values p strong { color: #34384c; font-size: 10px; }
.summary-total { margin-top: 14px; padding-top: 13px; border-top: 1px solid #e8e6f0; }
.summary-total span { color: #2f3346; font-size: 14px; font-weight: 700; }
.summary-total strong { color: var(--primary); font-size: 20px; }

.checkout-button {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding: 0 17px;
    color: #fff;
    background: linear-gradient(135deg, #7258ff, #6244ee);
    border: none;
    border-radius: 11px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 9px 22px rgba(113, 88, 255, .22);
}

.checkout-button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.checkout-button strong { font-size: 17px; }
.warning-modal-icon { color: #e58a28; background: #fff3e5; }

.sale-success-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 1200;
    padding: 13px 18px;
    color: #fff;
    background: #24a873;
    border-radius: 11px;
    box-shadow: 0 12px 30px rgba(20, 110, 75, .22);
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: .22s ease;
}

.sale-success-toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1250px) {
    .cashier-layout { grid-template-columns: 1fr; }
    .cashier-products-grid { max-height: 640px; }
    .check-items { max-height: 420px; }
}

@media (max-width: 760px) {
    .cashier-products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cashier-layout { display: block; }
    .cashier-check-panel { margin-top: 14px; }
    .check-table-head { display: none; }
    .check-item-row { grid-template-columns: 1fr 90px 30px; }
    .check-item-price { display: none; }
    .check-item-total { text-align: right; }
    .check-summary { grid-template-columns: 1fr; }
}


/* ================= Меню действий товара ================= */

.product-actions-cell {
    position: relative;
    overflow: visible;
}

.product-actions {
    position: relative;
    display: inline-flex;
}

.product-actions-menu {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 80;

    width: 178px;
    display: none;
    padding: 7px;

    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 14px 35px rgba(38, 34, 77, 0.16);
}

.product-actions.open .product-actions-menu {
    display: block;
    animation: productMenuAppear 0.16s ease;
}

@keyframes productMenuAppear {
    from {
        opacity: 0;
        transform: translateY(-5px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.product-actions-menu button {
    width: 100%;
    min-height: 39px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 0 10px;

    color: #4e5368;
    background: transparent;
    border: none;
    border-radius: 8px;

    font-size: 11px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: 0.18s ease;
}

.product-actions-menu button:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.product-actions-menu .delete-product-action {
    color: #e0525b;
}

.product-actions-menu .delete-product-action:hover {
    color: #d93f49;
    background: #fff0f1;
}

.product-actions-menu svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ================= Модальные окна ================= */

body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    visibility: hidden;
    opacity: 0;
    background: rgba(28, 28, 42, 0.42);
    backdrop-filter: blur(4px);

    transition: 0.2s ease;
}

.modal-overlay.visible {
    visibility: visible;
    opacity: 1;
}

.delete-modal {
    width: min(430px, 100%);
    padding: 30px;

    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(31, 27, 59, 0.24);

    text-align: center;
    transform: translateY(12px) scale(0.97);
    transition: 0.2s ease;
}

.modal-overlay.visible .delete-modal {
    transform: translateY(0) scale(1);
}

.delete-modal-icon {
    width: 54px;
    height: 54px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 17px;

    color: #e14f59;
    background: #fff0f1;
    border-radius: 15px;
}

.delete-modal-icon svg {
    width: 25px;
    height: 25px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.delete-modal h2 {
    margin-bottom: 10px;
    color: var(--text);
    font-size: 21px;
}

.delete-modal p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.delete-modal p strong {
    color: #484c61;
}

.delete-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 24px;
}

.modal-cancel-button,
.modal-delete-button {
    min-height: 44px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.18s ease;
}

.modal-cancel-button {
    color: #62677a;
    background: #ffffff;
    border: 1px solid var(--border);
}

.modal-cancel-button:hover {
    background: #f7f7fa;
}

.modal-delete-button {
    color: #ffffff;
    background: #e5535c;
    border: 1px solid #e5535c;
}

.modal-delete-button:hover {
    background: #d9434c;
    border-color: #d9434c;
}


@media (max-width: 1500px) and (min-width: 1251px) {
    .cashier-products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) and (min-width: 761px) {
    .cashier-products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


/* ================= Кастомные списки каталога ================= */

.catalog-custom-select {
    position: relative;
    min-width: 0;
}

.catalog-custom-select-button {
    width: 100%;
    height: 46px;

    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px;
    align-items: center;
    gap: 9px;

    padding: 0 13px;

    color: #555a70;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;

    text-align: left;
    cursor: pointer;
    transition: 0.18s ease;
}

.catalog-custom-select-button:hover {
    border-color: #d3cef7;
    background: #fdfcff;
}

.catalog-custom-select.open .catalog-custom-select-button {
    border-color: #bcb2ff;
    box-shadow: 0 0 0 3px rgba(113, 88, 255, 0.08);
}

.catalog-select-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.catalog-select-text small {
    color: #9a9daf;
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.catalog-select-text strong {
    overflow: hidden;

    color: #555a70;
    font-size: 10.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalog-custom-select-button > svg {
    width: 17px;
    height: 17px;

    fill: none;
    stroke: #8c90a2;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;

    transition: transform 0.18s ease;
}

.catalog-custom-select.open .catalog-custom-select-button > svg {
    color: var(--primary);
    transform: rotate(180deg);
}

.catalog-custom-select-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 250;

    width: 100%;
    min-width: 190px;
    max-height: 280px;
    overflow-y: auto;

    display: none;
    padding: 7px;

    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: 0 18px 45px rgba(35, 30, 70, 0.16);
    backdrop-filter: blur(12px);
}

.catalog-custom-select.open .catalog-custom-select-menu {
    display: block;
    animation: catalogSelectAppear 0.16s ease;
}

@keyframes catalogSelectAppear {
    from {
        opacity: 0;
        transform: translateY(-5px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.catalog-custom-select-menu button {
    position: relative;

    width: 100%;
    min-height: 39px;

    display: flex;
    align-items: center;

    padding: 0 34px 0 11px;

    color: #565b70;
    background: transparent;
    border: none;
    border-radius: 8px;

    font-size: 10.5px;
    font-weight: 550;
    text-align: left;

    cursor: pointer;
    transition: 0.15s ease;
}

.catalog-custom-select-menu button:hover {
    color: #5f47ed;
    background: #f5f2ff;
}

.catalog-custom-select-menu button.selected {
    color: #5f47ed;
    background: #eeeaff;
    font-weight: 650;
}

.catalog-custom-select-menu button.selected::after {
    content: "✓";

    position: absolute;
    right: 11px;

    color: #7158ff;
    font-size: 12px;
    font-weight: 700;
}

.catalog-custom-select-menu::-webkit-scrollbar {
    width: 6px;
}

.catalog-custom-select-menu::-webkit-scrollbar-thumb {
    background: #d8d3f5;
    border-radius: 999px;
}

.catalog-custom-select-menu::-webkit-scrollbar-track {
    background: transparent;
}

@media (max-width: 950px) {
    .catalog-custom-select.sorting-select {
        grid-column: span 2;
    }
}

@media (max-width: 700px) {
    .catalog-custom-select,
    .catalog-custom-select.sorting-select {
        grid-column: auto;
    }
}


/* ================= Динамические категории ================= */

.category-options-loading {
    padding: 12px;
    color: var(--muted);
    font-size: 10px;
    text-align: center;
}

.category-dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    display: inline-block;
    border-radius: 50%;
}

.category-badge.dynamic-category {
    font-weight: 600;
}
