/* static/css/styles.css */

/* Шрифт Roboto подключается в header.html (асинхронно). Не дублировать @import. */

/* Подключение кастомного шрифта TSATSKY BOLD */
@font-face {
    font-family: 'TSATSKY BOLD';
    src: url('/static/fonts/TSATSKY%20BOLD.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Глобальный шрифт для всего проекта */
* {
    font-family: 'Roboto', sans-serif;
}

html {
    scrollbar-gutter: stable;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #1c2526;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
        margin: 0;
}

body.login-page {
    min-height: 100vh;
    margin: 0;
    background: radial-gradient(circle at top, #ffe6f2 0%, #fef6ff 35%, #f5f5f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    padding: 36px 32px 42px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
}

.login-card::before,
.login-card::after {
    content: '';
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 192, 203, 0.35);
    filter: blur(10px);
    z-index: 0;
}

.login-card::before {
    top: -40px;
    right: -20px;
}

.login-card::after {
    bottom: -50px;
    left: -30px;
    background: rgba(255, 214, 165, 0.35);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.login-title {
    font-family: 'TSATSKY BOLD', sans-serif;
    font-size: 48px;
    letter-spacing: 4px;
    color: #1a202c;
    margin: 0;
}

.login-slogan {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    color: #4a5568;
    margin: 8px 0 0;
}

.login-emoji {
    font-size: 20px;
    margin-left: 6px;
}

.login-form {
    position: relative;
    z-index: 1;
}

.login-form .form-group {
    margin-bottom: 18px;
}

.login-form label {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 6px;
    display: block;
}

.login-form .custom-input {
    border-radius: 12px;
    border: 1px solid #d6d6d6;
    padding: 14px 16px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form .custom-input:focus {
    border-color: #f472b6;
    box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.25);
}

.login-form .custom-button {
    background: linear-gradient(120deg, #f59e0b 0%, #f472b6 100%);
    border-radius: 14px;
    border: none;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 12px 24px rgba(244, 114, 182, 0.25);
}

.login-form .custom-button:hover {
    background: linear-gradient(120deg, #f97316 0%, #ec4899 100%);
}

.flash-messages {
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.flash-messages p {
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flash-icon {
    font-size: 18px;
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 22px 34px;
    }

    .login-title {
        font-size: 40px;
    }
}

.telegram-link-page .login-container {
    max-width: 400px;
}

.telegram-link-page .login-card {
    max-width: 100%;
    box-sizing: border-box;
}

.telegram-link-body {
    position: relative;
    z-index: 1;
    max-width: 100%;
    box-sizing: border-box;
}

.telegram-link-title {
    font-family: 'Roboto', sans-serif;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0;
    color: #1a202c;
    margin: 0;
}

.telegram-link-page .login-slogan {
    font-size: 14px;
    margin-top: 6px;
}

.telegram-link-hint {
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #4a5568;
    margin: 0 0 20px;
    text-align: center;
}

.telegram-link-btn {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(120deg, #f59e0b 0%, #f472b6 100%);
    border: none;
    border-radius: 14px;
    padding: 15px 16px;
    box-shadow: 0 12px 24px rgba(244, 114, 182, 0.25);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.telegram-link-btn:hover {
    background: linear-gradient(120deg, #f97316 0%, #ec4899 100%);
    color: #fff;
}

.telegram-link-status {
    display: block;
    width: 100%;
    margin: 16px 0 0;
    padding: 0;
    font-size: 14px;
    color: #64748b;
    text-align: center;
}

@media (max-width: 480px) {
    .telegram-link-title {
        font-size: 20px;
    }
}

/* Главная — плитки в стиле account-card */
body.home-page .custom-grid {
    max-width: 1200px;
    margin: 12px auto 0;
    gap: 12px;
}

body.home-page .custom-tile {
    padding: 16px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: #1e293b;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    box-sizing: border-box;
    margin: 0;
    box-shadow: none;
    transition: background-color 0.2s, border-color 0.2s;
}

body.home-page .custom-tile:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: none;
    color: #1e293b;
}

.home-tile-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.home-tile-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

.home-tile-icon--sky {
    background: #e0f2fe;
    color: #0284c7;
}

.home-tile-icon--cyan {
    background: #ecfeff;
    color: #0891b2;
}

.home-tile-icon--violet {
    background: #ede9fe;
    color: #7c3aed;
}

.home-tile-icon--amber {
    background: #fef3c7;
    color: #d97706;
}

.home-tile-icon--emerald {
    background: #d1fae5;
    color: #059669;
}

.home-tile-icon--rose {
    background: #fce7f3;
    color: #db2777;
}

.home-tile-icon--indigo {
    background: #eef2ff;
    color: #6366f1;
}

.home-tile-icon--gold {
    background: #fef9c3;
    color: #b45309;
}

body.home-page .custom-tile-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    color: #1e293b;
}

body.home-page .custom-tile-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: #64748b;
    text-align: left;
}

/* Высота шапки — для calc() у модалок и др. (синхронизировать с min-height) */
:root {
    --custom-top-bar-height: 60px;
    --site-scrollbar-width: 17px;
    --modal-overlay-top: 0px;
    --modal-overlay-left: 0px;
    --modal-panel-width: 100%;
    --modal-panel-height: 100%;
}

.custom-top-bar {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    color: white;
    padding: 8px 0;
    margin-top: -8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    min-height: var(--custom-top-bar-height);
    box-sizing: border-box;
}

/* Бегущая строка статусов пользователей (вставляется в .custom-content, session-presence.html) */
.users-presence-marquee-host {
    width: 100%;
    box-sizing: border-box;
    margin: 5px 0 16px 0;
    /* Динамически меняем содержимое онлайн-строки — запретим браузеру
       выполнять компенсацию scroll-«якорем», которая и даёт дерганье. */
    overflow-anchor: none;
}

.users-presence-marquee-viewport {
    display: flex;
    align-items: center;
    overflow: hidden;
    width: 100%;
    background-color: #1c2526;
    padding: 8px 12px;
    border-radius: 8px;
    box-sizing: border-box;
    cursor: pointer;
}

/* Все онлайн помещаются — без прокрутки, по центру */
.users-presence-marquee-viewport.users-presence-marquee-viewport--static {
    cursor: default;
}

.users-presence-marquee-content {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
    width: max-content;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.92);
    animation: none;
    transform: none;
    will-change: auto;
}

.users-presence-marquee-content.users-presence-marquee-scrolling {
    animation: users-presence-marquee-scroll 45s linear infinite;
    will-change: transform;
    min-width: min-content;
}

.users-presence-marquee-content.users-presence-marquee-paused {
    animation-play-state: paused;
}

.users-presence-marquee-viewport--static .users-presence-marquee-content {
    transform: none !important;
    animation: none !important;
}

/* В static-режиме показываем только первую копию ленты,
   иначе пользователи отображаются дважды (вторую группу рисуем для плавного скролла). */
.users-presence-marquee-viewport--static .users-presence-marquee-group[aria-hidden="true"] {
    display: none;
}

.users-presence-marquee-group {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
    padding: 0 32px;
    flex-shrink: 0;
}

.users-presence-sep {
    padding: 0 14px;
    opacity: 0.45;
    user-select: none;
}

.users-presence-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
}

.users-presence-chip .status-indicator {
    margin-left: 0;
    flex-shrink: 0;
}

.users-presence-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.users-presence-empty {
    opacity: 0.65;
    padding: 0 16px;
}

@keyframes users-presence-marquee-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Медленное мигание индикатора «онлайн» (бегущая строка, админ-список) */
@keyframes status-indicator-online-pulse {
    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.35);
    }
    50% {
        opacity: 0.42;
        box-shadow: 0 0 8px 1px rgba(40, 167, 69, 0.45);
    }
}

@media (prefers-reduced-motion: reduce) {
    .status-online {
        animation: none !important;
        opacity: 1 !important;
        box-shadow: none !important;
    }
}

@media (max-width: 600px) {
    .users-presence-marquee-content {
        font-size: 12px;
    }
    .users-presence-marquee-group {
        padding: 0 20px;
    }
    .users-presence-name {
        max-width: 140px;
    }
}

.logo-title-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    text-align: center;
    position: relative;
    min-height: var(--custom-top-bar-height);
}

.site-logo-link,
.custom-title-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.2s ease;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.site-logo-link:hover,
.custom-title-link:hover {
    opacity: 0.8;
}

.site-logo-link:focus,
.custom-title-link:focus {
    outline-offset: 2px;
    border-radius: 4px;
}

.site-logo {
    height: 45px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
    display: block;
    opacity: 0;
    visibility: hidden;
    animation: logoFadeInOut 20s infinite;
    animation-fill-mode: both;
    animation-delay: 0s;
}

.custom-title {
    font-family: 'TSATSKY BOLD', sans-serif;
    font-size: 30px;
    font-weight: normal;
    display: inline-block;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    animation: titleFadeInOut 20s infinite;
    animation-fill-mode: both;
    animation-delay: 0s;
}

@keyframes logoFadeInOut {
    0% {
        opacity: 0;
        visibility: visible;
    }
    15% {
        opacity: 1;
        visibility: visible;
    }
    35% {
        opacity: 1;
        visibility: visible;
    }
    50% {
        opacity: 0;
        visibility: hidden;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes titleFadeInOut {
    0% {
        opacity: 0;
        visibility: hidden;
    }
    50% {
        opacity: 0;
        visibility: hidden;
    }
    65% {
        opacity: 1;
        visibility: visible;
    }
    85% {
        opacity: 1;
        visibility: visible;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}


.custom-menu-list {
    margin-top: 24px;
    list-style: none;
    padding: 0;
}

.custom-menu-link {
    font-family: 'Roboto', sans-serif;
    color: white;
    text-decoration: none;
    display: block;
    padding: 8px 0;
	font-size:18px;
}

.custom-menu-link:hover {
    color: #d1d5db;
}

.custom-menu-link--with-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.menu-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.menu-unread-badge.is-hidden {
    display: none !important;
}

.custom-content {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    padding-left: 10px;
    padding-right: 10px;
    background-color: white;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
    margin-top: 0;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

.title-with-cart {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px;
    position: relative;
    width: 100%;
}

.custom-main-title {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin: 1em 0;
    flex: 1;
}

.cart-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #334155;
    transition: color 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.cart-icon-btn:hover {
    color: #10b981;
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #10b981;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
}

.cart-count:empty {
    display: none;
}

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

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

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

.custom-tile {
    background-color: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    text-decoration: none;
    color: #2d3748;
    transition: box-shadow 0.3s;
    margin: 0px 20px 0px 20px;
}

.custom-tile:hover {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

.custom-tile-title {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 8px 0;
}

.custom-tile-subtitle {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: normal;
    color: #64748b;
    margin: 0;
}

.search-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 10px;
}

.filter-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.custom-filter-button {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    background-color: #e0e0e0;
    color: #2d3748;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s, color 0.3s;
}

.custom-filter-button.active {
    background-color: #48bb78;
    color: white;
}

.custom-filter-button:hover {
    background-color: #d0d0d0;
}

.custom-filter-button.active:hover {
    background-color: #38a169;
}

.filter-content {
    width: 100%;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.custom-articles {
    margin-bottom: 12px;
    max-height: 220px;
    overflow-y: auto;
}

.custom-article-item {
    font-family: 'Roboto', sans-serif;
    padding: 7px 5px;
    background-color: #e6f0fa;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-article-item:hover {
    background-color: #cce0ff;
}

.article-text {
    flex-grow: 1;
    cursor: pointer;
}

.custom-variations {
    margin-top: 12px;
}

.custom-variation-group {
    margin-bottom: 12px;
}

.custom-variation-title {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
}

.custom-point-name {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: #2b6cb0;
	margin-bottom: 10px;
}

.custom-variation-item {
    font-family: 'Roboto', sans-serif;
    border-radius: 4px;
    margin-bottom: 8px;
    display: grid;
    gap: 3px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
    /* корзина | размер | вес | бриллиант | 1/585 | штрихкод | цены */
    grid-template-columns:
        minmax(36px, 1.1fr)
        minmax(max-content, 0.9fr)
        minmax(36px, 1fr)
        minmax(28px, 0.85fr)
        minmax(36px, 1fr)
        minmax(28px, 0.85fr)
        minmax(72px, 2fr);
}

/* Без кнопки камней — колонка бриллианта не резервируется */
.custom-variation-item.no-stone-btn {
    grid-template-columns:
        minmax(36px, 1.1fr)
        minmax(max-content, 0.9fr)
        minmax(36px, 1fr)
        minmax(36px, 1fr)
        minmax(28px, 0.85fr)
        minmax(72px, 2fr);
}

/* Нет размера — колонка размера не резервируется */
.custom-variation-item.no-size {
    grid-template-columns:
        minmax(36px, 1.1fr)
        minmax(36px, 1fr)
        minmax(28px, 0.85fr)
        minmax(36px, 1fr)
        minmax(28px, 0.85fr)
        minmax(72px, 2fr);
}

.custom-variation-item.no-size.no-stone-btn {
    grid-template-columns:
        minmax(36px, 1.1fr)
        minmax(36px, 1fr)
        minmax(36px, 1fr)
        minmax(28px, 0.85fr)
        minmax(72px, 2fr);
}

.cart-add-btn {
    background: #dddddd;
    border: none;
    cursor: pointer;
    height: 100%;
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3c3c3c;
    transition: color 0.2s ease, transform 0.1s ease;
    border-radius: 4px;
}

.cart-add-btn:hover {
    color: #10b981;
}

.cart-add-btn:active {
    transform: scale(0.95);
}

.stone-btn-wrap,
.barcode-btn-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    width: 100%;
}

.stone-btn {
    color: #1a1a1a;
}

.stone-btn.has-stones {
    color: #059669;
}

.stone-btn.has-stones:hover {
    color: #047857;
}

.variation-qty-grade {
    background-color: #dddddd;
    padding: 4px 2px;
    border-radius: 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.variation-qty-grade .vqg-qty {
    font-size: 13px;
    font-weight: 600;
    color: #1a202c;
}

.variation-qty-grade .vqg-grade {
    font-size: 10px;
    color: #64748b;
    margin-top: 1px;
}

.stone-tooltip {
    /* fixed + JS-привязка к кнопке: едет при скролле окна и внутренних контейнеров */
    position: fixed;
    z-index: 10050;
    min-width: 300px;
    max-width: min(92vw, 360px);
    background: #1c2526;
    color: #f8fafc;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.35);
    font-size: 14px;
    box-sizing: border-box;
}

.stone-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1c2526;
}

.stone-tooltip.stone-tooltip-below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #1c2526;
}

.stone-tooltip-title {
    font-weight: 600;
    margin-bottom: 8px;
    word-break: break-all;
}

.stone-tooltip-textarea {
    width: 100%;
    min-height: 110px;
    max-height: 55vh;
    box-sizing: border-box;
    border-radius: 6px;
    border: 1px solid #475569;
    background: #c2c3c6;
    color: #000000;
    padding: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.35;
    resize: none;
    overflow-y: hidden;
}

.stone-tooltip-cost-label {
    display: block;
    margin-top: 8px;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
}

.stone-tooltip-cost-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #475569;
    border-radius: 6px;
    background: #c2c3c6;
    color: #000;
    padding: 8px;
    font-family: inherit;
    font-size: 14px;
}

.stone-tooltip-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
}

.stone-tooltip-save,
.stone-tooltip-close {
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
}

.stone-tooltip-save {
    background: #059669;
    color: #fff;
}

.stone-tooltip-save:disabled {
    opacity: 0.6;
    cursor: wait;
}

.stone-tooltip-close {
    background: #475569;
    color: #fff;
}

.cart-content {
    padding: 20px 0;
}

.cart-item {
        position: relative;
    display: flex;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    background: #f3f3f3;
    border-radius: 10px;
    margin: 10px 5px;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image-wrap {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f1f5f9;
}

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

.cart-item-replace-btn {
    width: 100%;
    height: 28px;
    background-color: #10b981;
    border: none;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    padding: 0 6px;
    transition: all 0.2s ease;
    font-size: 10px;
}

.cart-item-replace-btn:hover {
    background-color: #0d9668;
    transform: none;
}

.cart-item-replace-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.cart-item-content {
    flex: 1;
    min-width: 0;
}

.cart-item-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.cart-item-header .custom-point-name {
    font-size: 16px;
    font-weight: 600;
}

.cart-item-article {
    font-weight: 550;
    color: #191919;
    font-size: 14px;
}

.cart-item-columns {
    display: grid;
    grid-template-columns: 60% 15% 22%;
    gap: 5px;
    align-items: center;
}

.cart-item-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.cart-item-details {
    font-size: 14px;
    color: #64748b;
    min-width: 0;
    word-wrap: break-word;
}

.cart-item-discount-input {
    align-items: flex-start;
    flex-shrink: 0;
}

.cart-item-price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.cart-item-remove-col {
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.discount-input-field {
    width: 90%;
    padding: 10px 2px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    text-align: center;
}

.discount-input-field:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.cart-item-price-original {
    font-size: 12px;
    color: #94a3b8;
    text-decoration: line-through;
}

.cart-item-price {
    font-weight: 600;
    color: #10b981;
    font-size: 18px;
    text-align: right;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    margin-top: 16px;
    border-top: 2px solid #e2e8f0;
    background-color: #f8fafc;
    border-radius: 8px;
}

.cart-total-label {
    font-size: 18px;
    font-weight: 600;
    color: #334155;
}

.cart-total-price {
    font-size: 20px;
    font-weight: 700;
    color: #10b981;
}

/* === Журнал продаж: модалка, сохранённые и черновик === */
.title-with-cart--sales .custom-main-title {
    margin-bottom: 0;
}

.sales-draft-block {
    margin-top: 16px;
}

.sales-draft-block .custom-section-title,
.sales-saved-block .custom-section-title {
    margin: 0 0 8px;
    font-size: 16px;
}

.sales-saved-block {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.sales-saved-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sales-saved-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.sales-saved-refresh-btn {
    padding: 6px 12px;
    font-size: 13px;
}

.sales-saved-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}

.sales-saved-filter-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
}

.sales-saved-filter-btn.is-active {
    background: #ecfdf5;
    border-color: #10b981;
    color: #047857;
}

.sales-saved-filter-btn[hidden] {
    display: none !important;
}

.sales-saved-filter-btn-sum {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.sales-saved-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#salesCartContent .sales-draft-item,
#salesSavedList .sales-draft-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #10b981;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    border-radius: 8px;
    padding: 8px;
    margin: 6px 0;
    gap: 0;
    position: relative;
}

/* Место под ✖ только в верхней строке — meta и цены на всю ширину карточки */
#salesCartContent .sales-draft-item > .cart-item-remove {
    top: 6px;
    right: 6px;
}

#salesCartContent .sales-draft-thumb-header-row {
    padding-right: 32px;
}

#salesSavedList .sales-saved-item .sales-draft-thumb-header-row {
    padding-right: 64px;
}

#salesSavedList .sales-saved-item--in-draft {
    border-left-color: #10b981;
}

#salesSavedList .sales-saved-item--not-in-draft {
    border-left-color: #f59e0b;
}

#salesCartContent .sales-draft-item .cart-item-image,
#salesSavedList .sales-draft-item .cart-item-image {
    width: 72px;
    height: 72px;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

#salesCartContent .sales-draft-item-body,
#salesSavedList .sales-draft-item-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

#salesCartContent .sales-draft-top-row,
#salesSavedList .sales-draft-top-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

#salesCartContent .sales-draft-thumb-header-row,
#salesSavedList .sales-draft-thumb-header-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

#salesCartContent .sales-draft-thumb-header-row .cart-item-image-wrap,
#salesSavedList .sales-draft-thumb-header-row .cart-item-image-wrap {
    margin: 0;
    flex-shrink: 0;
}

#salesCartContent .sales-draft-thumb-header-row .sales-draft-header-block,
#salesSavedList .sales-draft-thumb-header-row .sales-draft-header-block {
    flex: 1 1 140px;
    min-width: 0;
    gap: 2px;
    margin-bottom: 0;
}

#salesCartContent .sales-draft-thumb-header-row .cart-item-header,
#salesSavedList .sales-draft-thumb-header-row .cart-item-header {
    margin-bottom: 0;
}

#salesCartContent .sales-draft-header-selects,
#salesSavedList .sales-draft-header-selects {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
}

#salesCartContent .sales-draft-line-metal,
#salesCartContent .sales-draft-line-seller,
#salesSavedList .sales-draft-line-metal,
#salesSavedList .sales-draft-line-seller {
    flex: 1 1 120px;
    min-width: 0;
    margin: 0;
    padding: 6px 8px;
    font-size: 13px;
    line-height: 1.25;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    box-sizing: border-box;
}

#salesCartContent .sales-draft-col-details,
#salesSavedList .sales-draft-col-details {
    width: 100%;
    min-width: 0;
}

#salesCartContent .sales-draft-meta,
#salesSavedList .sales-draft-meta {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
    max-width: 100%;
}

#salesCartContent .sales-draft-meta::-webkit-scrollbar,
#salesSavedList .sales-draft-meta::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

#salesCartContent .sales-draft-meta-chip,
#salesSavedList .sales-draft-meta-chip {
    box-sizing: border-box;
    display: inline-flex;
    flex-direction: row;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    min-height: 0;
    padding: 4px 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    line-height: 1.2;
    flex-shrink: 0;
    white-space: nowrap;
}

#salesCartContent .sales-draft-meta-chip--value-only,
#salesSavedList .sales-draft-meta-chip--value-only {
    justify-content: center;
}

#salesCartContent .sales-draft-meta-label,
#salesSavedList .sales-draft-meta-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
}

#salesCartContent .sales-draft-meta-value,
#salesSavedList .sales-draft-meta-value {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    word-break: normal;
}

#salesCartContent .sales-draft-col-details.cart-item-details,
#salesSavedList .sales-draft-col-details.cart-item-details {
    word-wrap: normal;
    overflow-wrap: normal;
}

#salesCartContent .sales-draft-meta-chip--barcode .sales-draft-meta-value,
#salesSavedList .sales-draft-meta-chip--barcode .sales-draft-meta-value {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 11px;
    white-space: nowrap;
}

#salesCartContent .sales-draft-columns,
#salesSavedList .sales-draft-columns {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: stretch;
    gap: 8px;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#salesCartContent .sales-draft-columns .cart-item-col,
#salesSavedList .sales-draft-columns .cart-item-col {
    flex: 1 1 0;
    min-width: 80px;
    margin: 0;
}

#salesCartContent .sales-draft-tag-unified,
#salesSavedList .sales-draft-tag-unified {
    box-sizing: border-box;
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

#salesCartContent .sales-draft-tag-unified-label,
#salesSavedList .sales-draft-tag-unified-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

#salesCartContent .sales-draft-tag-unified-sum,
#salesSavedList .sales-draft-tag-unified-sum {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

#salesCartContent .sales-draft-discount-input,
#salesCartContent .sales-draft-sale-sum,
#salesSavedList .sales-draft-discount-input,
#salesSavedList .sales-draft-sale-sum {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    min-height: 34px;
}

#salesCartContent .sales-draft-sale-sum,
#salesSavedList .sales-draft-sale-sum {
    font-weight: 600;
    color: #10b981;
    text-align: right;
}

.sales-saved-card-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 11;
}

.sales-saved-edit-btn,
.sales-saved-done-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #334155;
}

.sales-saved-done-btn {
    background: #ecfdf5;
    color: #059669;
    font-weight: 700;
}

.sales-saved-status {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

#salesSavedList .sales-saved-card-actions .cart-item-remove {
    position: static;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 16px;
}

@media (max-width: 640px) {
    #salesCartContent .sales-draft-columns,
    #salesSavedList .sales-draft-columns {
        flex-wrap: wrap;
    }
}

.cart-item-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #ef4444;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 10;
}

.cart-item-remove:hover {
    background-color: #fee2e2;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.variation-size,
.variation-weight,
.variation-grade,
.variation-quantity,
.variation-barcode,
.variation-price,
.variation-discounted-price,
.variation-prices {
    background-color: #dddddd;
    padding: 8px 4px;
    border-radius: 4px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.variation-size {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    padding: 8px 3px;
    white-space: nowrap;
    box-sizing: border-box;
}

.variation-weight,
.variation-grade,
.variation-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
}

.variation-barcode {
    font-size: 0.85em;
    word-break: break-all;
}

.barcode-tooltip {
    /* fixed + JS-привязка к кнопке при скролле */
    position: fixed;
    z-index: 10001;
    background: #1e293b;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    pointer-events: none;
}

.barcode-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

.variation-prices {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 4px 2px;
    overflow: visible;
    line-height: 1.15;
    min-width: 0;
}

.variation-prices .variation-price,
.variation-prices .variation-discounted-price {
    background: transparent;
    padding: 0 2px;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
}

.variation-price {
    color: #3182ce;
}

.variation-discounted-price {
    font-weight: bold;
    color: #48bb78;
}

.discount-input-group {
    font-family: 'Roboto', sans-serif;
    color: #2d3748;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    padding: 16px;
    box-sizing: border-box;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.discount-inputs-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    align-self: start;
}

.discount-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.discount-label {
    font-weight: 500;
    font-size: 14px;
    color: #374151;
    white-space: nowrap;
}

.discount-input {
    min-width: 0;
    width: 100%;
    max-width: 200px;
}

.discount-input input {
    width: 100%;
    padding: 10px 12px;
    text-align: center;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    background: white;
    transition: all 0.2s ease;
}

.discount-input input:hover {
    border-color: #9ca3af;
}

.discount-input input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.discount-image {
    width: 150px;
    height: 150px;
    min-width: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
    align-self: start;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .discount-input-group {
        grid-template-columns: 1fr auto;
        gap: 16px;
        padding: 12px;
    }
    
    .discount-inputs-wrapper {
        gap: 12px;
    }
    
    .discount-input {
        max-width: 100%;
    }
    
    .discount-input input {
        max-width: 100%;
        width: 100%;
    }
    
    .discount-image {
        width: 100%;
        max-width: 200px;
        height: auto;
        aspect-ratio: 1;
        margin: 0 auto;
        justify-self: center;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .discount-input-group {
        padding: 10px;
        gap: 12px;
    }
    
    .discount-inputs-wrapper {
        gap: 10px;
    }
    
    .discount-input input {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .discount-label {
        font-size: 13px;
    }
    
    .discount-image {
        max-width: 150px;
    }
}

.custom-button {
    font-family: 'Roboto', sans-serif;
    background-color: #10b981;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

.custom-button:hover {
    background-color: #059669;
}

.sidebar {
    height: 100%;
    width: 250px;
    position: fixed;
    top: 0;
    right: -350px;
    background-color: #1c2526;
    padding: 20px;
    transition: 0.3s;
    z-index: 10;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.3);
    color: white;
    overflow-y: auto;
}

.sidebar.active {
    right: 0;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 5;
}

.overlay.active {
    display: block;
}

.menu-button {
    font-family: 'Roboto', sans-serif;
    position: relative;
    top: auto;
    right: auto;
    background-color: #cdcbcb;
    color: #000000;
    border: none;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    z-index: 1;
    margin-right: var(--site-scrollbar-width, 17px);
    flex-shrink: 0;
}

body.modal-open .menu-button {
    margin-right: 0;
}

@media (max-width: 1023px) {
    .menu-button {
        margin-right: 5px;
    }

    body.modal-open .menu-button {
        margin-right: 5px;
    }
}

.menu-button:hover {
    background-color: #b0aeae;
}

.close-button {
    position: absolute;
    top: -9px;
    right: 0;
    margin: 0;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    z-index: 1;
}

.close-button:hover {
    color: #ff4444;
}

.image-button {
    font-family: 'Roboto', sans-serif;
    background-color: #3182ce;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-left: 8px;
}

.image-button:hover {
    background-color: #2b6cb0;
}

.upload-image-button {
    font-family: 'Roboto', sans-serif;
    background-color: #e0e0e0;
    color: #2d3748;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-left: 8px;
}

.upload-image-button:hover {
    background-color: #d0d0d0;
}

body.modal-open {
    overflow: hidden;
    padding-right: var(--site-scrollbar-width, 17px);
}

@media (max-width: 1023px) {
    body.modal-open {
        padding-right: 0;
    }
}

@media (min-width: 1024px) {
    html {
        scrollbar-gutter: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    html::-webkit-scrollbar {
        width: 0;
        height: 0;
        display: none;
    }

    .menu-button {
        margin-right: 8px;
    }

    body.modal-open {
        padding-right: 0;
    }

    body.modal-open .menu-button {
        margin-right: 8px;
    }
}

.modal {
    display: flex;
    position: fixed;
    top: var(--modal-overlay-top, 0);
    right: 0;
    bottom: 0;
    left: 0;
    align-items: flex-start;
    justify-content: flex-start;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0s linear 0.3s;
    pointer-events: none;
    transform: translateZ(0);
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: hidden;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease-out, visibility 0s linear 0s;
    pointer-events: auto;
}

.modal-content,
.schedule-day-modal-panel {
    background-color: white;
    padding: 5px 10px;
    border-radius: 8px 8px 0 0;
    max-width: 100%;
    width: 100%;
    height: var(--modal-panel-height, 100%);
    max-height: 100%;
    min-height: 0;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.12);
    box-sizing: border-box;
    margin: 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active .modal-content,
.modal.active .schedule-day-modal-panel {
    transform: translateY(0);
}

@media (min-width: 1024px) {
    .modal {
        justify-content: center;
    }

    .modal-content:not(.characteristics-modal-content):not(.value-info-modal-content),
    .schedule-day-modal-panel {
        max-width: 1400px;
        width: 100%;
        margin: 0 auto;
    }
}

@media (min-width: 1440px) {
    .modal-content:not(.characteristics-modal-content):not(.value-info-modal-content),
    .schedule-day-modal-panel {
        max-width: 1460px;
        width: 100%;
        margin: 0 auto;
    }
}

.modal-article {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 16px;
    text-align: center;
}

.modal-image-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 460px;
    max-height: 460px;
    overflow: hidden;
    margin-bottom: 16px;
    touch-action: pan-y;
    will-change: transform, opacity;
}

.modal-image-gallery.media-out-left {
    animation: mediaOutLeft 0.3s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

.modal-image-gallery.media-out-right {
    animation: mediaOutRight 0.3s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

.modal-image-gallery.media-in-left {
    animation: mediaInLeft 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.modal-image-gallery.media-in-right {
    animation: mediaInRight 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes mediaOutLeft {
    from { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
    to { transform: translate3d(-22%, 0, 0) scale(0.97); opacity: 0; }
}

@keyframes mediaOutRight {
    from { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
    to { transform: translate3d(22%, 0, 0) scale(0.97); opacity: 0; }
}

@keyframes mediaInLeft {
    from { transform: translate3d(-22%, 0, 0) scale(0.97); opacity: 0; }
    to { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
}

@keyframes mediaInRight {
    from { transform: translate3d(22%, 0, 0) scale(0.97); opacity: 0; }
    to { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .modal-image-gallery.media-out-left,
    .modal-image-gallery.media-out-right,
    .modal-image-gallery.media-in-left,
    .modal-image-gallery.media-in-right {
        animation: none;
    }
}

.modal-image-gallery.no-images .modal-image {
    display: none;
}

.modal-image {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 4px;
}

/* На всю ширину модалки (как фото); без max-height — иначе не растягивается по ширине */
.modal-video {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    background: #0f172a;
    display: block;
}

.modal-image-gallery.is-video {
    height: auto;
    min-height: 200px;
    max-height: none;
    background: #0f172a;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 0 8px;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background-color: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    outline: none;
}

.carousel-indicator:hover {
    background-color: rgba(0, 0, 0, 0.5);
    transform: scale(1.2);
}

.carousel-indicator.active {
    background-color: #1a202c;
    width: 12px;
    height: 12px;
    box-shadow: 0 0 0 2px rgba(26, 32, 44, 0.3);
}

.carousel-indicator:focus {
    outline: 2px solid rgba(66, 153, 225, 0.5);
    outline-offset: 2px;
}

.carousel-button {
    font-family: 'Roboto', sans-serif;
    background-color: #1a202c;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    width: 48px;
    height: 40px;
    line-height: 1;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.carousel-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.carousel-button:hover {
    background-color: #2d3748;
    transform: scale(1.1);
}

.carousel-button:hover::before {
    width: 100%;
    height: 100%;
}

.carousel-button:active {
    transform: scale(0.95);
}

.carousel-button:focus {
    outline: none;
    outline-offset: 2px;
}

.carousel-button.prev,
.carousel-button.next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.carousel-icon {
    display: inline-block;
    line-height: 1;
    font-weight: 900;
    font-size: 24px;
    position: relative;
    top: -1px;
}

.add-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.add-image-button {
    font-family: 'Roboto', sans-serif;
    background-color: #1a202c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    height: 40px;
    line-height: 20px;
}

.add-image-button:hover {
    background-color: #38a169;
}

@media (max-width: 600px) {
    .modal-content {
        padding: 5px;
    }
    .image-button {
        padding: 10px 15px;
        font-size: 12px;
    }
    .upload-image-button {
        padding: 4px 8px;
        font-size: 12px;
    }
    .modal-image-gallery {
        max-height: 350px;
    }
    .modal-image-gallery.is-video {
        max-height: none;
    }
    .carousel-button {
        padding: 0 18px;
        font-size: 14px;
        height: 36px; /* Соответствует уменьшенной высоте .add-image-button */
        line-height: 36px;
    }
    .add-image-button {
        padding: 8px 16px;
        font-size: 14px;
        height: 36px;
        line-height: 20px;
    }
    .filter-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    .custom-filter-button {
        width: 100%;
        height: 40px;
        font-size: 14px;
    }
    .filter-content {
        max-width: 100%;
    }
}
/* Стили для горизонтального заголовка меню */
.menu-header {
    display: flex;
    /* Выравнивает элементы по вертикали по центру */
    align-items: center; 
    /* Равномерно распределяет пространство между элементами */
    justify-content: space-between;
	border-bottom: 3px solid #000000;
    padding-bottom: 16px;
	font-family: 'Roboto', sans-serif;
    position: relative;
}

.custom-menu-title {
    font-family: 'Roboto', sans-serif;
    font-size: 1.25em;
    font-weight: bold;
    margin: 0;
    position: absolute;
}

/* Базовый стиль для блока статуса в боковом меню */
.db-status-badge {
    padding: 6px 8px;
    border-radius: 6px;
    margin: 0 69px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    /* Запрещаем элементу сжиматься, чтобы он не выглядел сплющенным */
    flex-shrink: 0; 
}

/* Статус: Сегодня (Зеленый) */
.status-today {
    background-color: #22c55e; /* Green-600 */
    color: white;
}

/* Статус: Вчера (Оранжевый) */
.status-yesterday {
    background-color: #f97316; /* Orange-600 */
    color: white;
}

/* Статус: Два и более дней (Красный) */
.status-old {
    background-color: #ef4444; /* Red-500 */
    color: white;
}

/* Статус: Файл не найден (Серый) */
.status-missing {
    background-color: #cbd5e1; /* Gray-300 */
    color: #4b5563; /* Gray-700 */
}
.carousel-buttons-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0 8px;
}

.action-buttons-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    transition: margin-top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-buttons-container.center-toggle {
    justify-content: center;
}

.carousel-buttons-container.center-toggle {
    justify-content: center;
}

/* Panel that appears below action-buttons-container when toggled */
.action-buttons-center { display:flex; align-items:center; justify-content:center; position:relative; }
.accordion-toggle {
    font-family: 'Roboto', sans-serif;
    background-color: #1a202c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    height: 40px;
    line-height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    position: relative;
}
/* Состояние "открыто" */
.accordion-toggle[aria-expanded="true"] {
    background-color: #38a169;
}

.accordion-toggle[aria-expanded="true"]:hover {
    background-color: #2f855a;
}

.accordion-toggle:focus {
    outline-offset: 2px;
}


@media (max-width: 600px) {
    .accordion-toggle {
        padding: 8px 50px;
        font-size: 14px;
        height: 36px;
        line-height: 20px;
    }
}

.action-buttons-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: transparent;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    opacity: 0;
    transform: scaleY(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 0;
    overflow: hidden;
    position: relative;
    transform-origin: top;
    scale: 1;
    will-change: transform, opacity, max-height;
    /* Улучшаем производительность анимаций на мобильных */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.action-buttons-container.expanded-down .action-buttons-panel {
    opacity: 1;
    transform: scaleY(1);
    max-height: 200px;
    scale: 1;
}

/* Add margin-top when panel is expanded to prevent jumping */
.action-buttons-container.expanded-down {
    margin-top: 8px;
}

/* Styles for characteristics panel */
.characteristics-panel-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    transition: margin-top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10;
    margin-top: 16px;
}

.characteristics-panel-container.center-toggle {
    justify-content: center;
}

.characteristics-toggle {
    font-family: 'Roboto', sans-serif;
    background-color: #4F46E5;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    height: 40px;
    line-height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    position: relative;
    margin-bottom: 10px;
	margin-top: 10px;
}

.characteristics-toggle[aria-expanded="true"] {
    background-color: #3730A3;
}

.characteristics-toggle[aria-expanded="true"]:hover {
    background-color: #3730A3;
}

.characteristics-toggle:hover {
    background-color: #4338CA;
}

.characteristics-toggle:focus {
    outline: 2px solid #4F46E5;
    outline-offset: 2px;
}

/* Characteristics Modal Styles — анимация как у .modal (без display:none) */
#characteristicsModal {
    z-index: 1001;
}

.modal-content.characteristics-modal-content,
.characteristics-modal-content {
    background-color: white;
    padding: 5px 10px;
    border-radius: 8px 8px 0 0;
    max-width: 100%;
    width: 100%;
    height: var(--modal-panel-height, 100%);
    max-height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.12);
    margin: 0;
    left: auto;
    right: auto;
    transform: translate3d(0, 100%, 0);
    transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-sizing: border-box;
    will-change: transform;
}

#characteristicsModal.active .modal-content.characteristics-modal-content,
#characteristicsModal.active .characteristics-modal-content {
    transform: translate3d(0, 0, 0);
}

/* Та же ширина, что у .custom-content / остальных модалок на десктопе */
@media (min-width: 1024px) {
    .modal-content.characteristics-modal-content,
    .characteristics-modal-content {
        max-width: 1400px;
        width: 100%;
        margin: 0 auto;
    }
}

@media (min-width: 1440px) {
    .modal-content.characteristics-modal-content,
    .characteristics-modal-content {
        max-width: 1460px;
        width: 100%;
        margin: 0 auto;
    }
}



.modal-title {
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #454545;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.modal-close:hover {
    background-color: #f1f5f9;
    color: #334155;
}

.characteristics-form {
    width: 100%;
    padding: 0 10px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .modal-content.characteristics-modal-content,
    .characteristics-modal-content {
        width: 100%;
        max-width: 100%;
    }
    
    .modal-title {
        font-size: 14px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .modal-close {
        top: 12px;
        right: 15px;
        font-size: 25px;
        width: 25px;
        height: 25px;
    }
}

/* Ensure all form elements stay within bounds */

/* Mobile responsive */
@media (max-width: 640px) {
    .form-section {
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 14px;
    }
    
    .custom-input, .custom-textarea, .custom-select {
        font-size: 14px;
        padding: 8px 10px;
    }
    
    .custom-textarea {
        min-height: 50px;
        font-size: 14px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .save-characteristics-btn, .load-characteristics-btn {
        width: 100%;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .modal-close {
        z-index: 999;
    }
}

/* Responsive table styles for characteristics management */
/* Mobile responsive - make table scrollable */
@media (max-width: 768px) {
    .data-table-container {
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .data-table {
        font-size: 12px;
        min-width: 500px; /* Smaller minimum width for mobile */
    }
    
    .data-table th, .data-table td {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .edit-btn, .delete-btn {
        padding: 4px 8px;
        font-size: 10px;
        margin: 0 1px;
    }
}

/* Tablet responsive */
@media (max-width: 1024px) {
    .data-table {
        font-size: 13px;
        min-width: 550px;
    }
    
    .data-table th, .data-table td {
        padding: 9px 14px;
        font-size: 12px;
    }
}

/* Ensure table headers are sticky on mobile */
@media (max-width: 768px) {
    .data-table th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
}

/* Compact form styles */
.custom-input, .custom-select, .custom-textarea {
    width: 100%;
    padding: 10px 12px;
	margin-bottom: 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    box-sizing: border-box;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex-shrink: 0;
}

.custom-input:focus, .custom-select:focus, .custom-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}


/* Section header styles */

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

/* Form container styles */
#characteristicFormContainer {
    margin: 20px 0;
    margin-bottom: 60px;
    padding: 24px;
    padding-bottom: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: visible;
    box-sizing: border-box;
}

/* Ensure form-actions stays inside the container */
#characteristicFormContainer .form-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    margin-bottom: 0;
    padding-top: 16px;
    padding-bottom: 16px;
    border-top: 2px solid #e5e7eb;
    position: static;
    width: 100%;
    box-sizing: border-box;
}

/* Message styles */
.no-characteristics-message, .error-message {
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
}

.no-characteristics-message {
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    color: #234e52;
    border: 1px solid #b2f5ea;
}

.error-message {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #742a2a;
    border: 1px solid #feb2b2;
}

/* Remove duplicate characteristics-form styles - these are now handled by the modal styles */

.action-buttons-panel .add-image-button,
.action-buttons-panel .delete-image-button {
    width: 50%;
    font-size: 16px;
    font-weight: 600;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Ensure delete button style consistent */
.delete-image-button {
    background: #d9534f;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    min-width: 120px;
    opacity: 1;
    visibility: visible;
}
.delete-image-button:hover {
    background: #c82333;
}
.delete-image-button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    background: #ccc;
}

.action-buttons-panel .add-image-button {
    background: #1a202c;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    min-width: 120px;
    opacity: 1;
    visibility: visible;
}
.action-buttons-panel .add-image-button:hover {
    background: #2d3748;
}

/* Ensure modal overlay doesn't clip the panel */
/* On small screens keep panel styling consistent */
@media (max-width: 640px) {
    .action-buttons-panel {
        max-width: 100%;
        margin: 0 16px;
        flex-direction: column;
        gap: 8px;
    }
    
    .carousel-buttons-container {
        margin-bottom: 0px;
        transition: margin-bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        gap: 8px;
        padding: 0 4px;
    }
    
    .carousel-button {
        width: 42px;
        height: 36px;
        font-size: 18px;
    }
    
    .carousel-indicators {
        gap: 6px;
        margin-bottom: 12px;
    }
    
    .carousel-indicator {
        width: 8px;
        height: 8px;
    }
    
    .carousel-indicator.active {
        width: 10px;
        height: 10px;
    }
    
    .action-buttons-panel .add-image-button,
    .action-buttons-panel .delete-image-button {
        min-width: 100%;
        font-size: 14px;
        padding: 8px 12px;
    }
}
/* Стили для раздвигающихся форм */
        .form-container {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease-in-out;
            margin-bottom: 5px;
            padding: 0;
            border: none;
            background: transparent;
        }
        .form-container.active {
            max-height: 700px;
            padding: 20px;
            border: 1px solid #e5e7eb;
            background: #f9fafb;
            border-radius: 5px;
        }
        .user-menu-container {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease-in-out;
        }
        .user-menu-container.active {
            max-height: 800px;
            padding: 10px;
            background-color: #f9f9f9;
            border: 1px solid #ccc;
            border-radius: 5px;
            margin: 10px 0;
        }
        .form-toggle-button, .user-toggle-button {
            background-color: #10b981;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            display: block;
            width: 100%;
            text-align: left;
            margin-bottom: 5px;
            position: relative;
        }
        .form-toggle-button:hover, .user-toggle-button:hover {
            background-color: #059669;
        }
        .delete-button, .end-session-button {
            background-color: #ff0000;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 4px;
            cursor: pointer;
            margin-top: 10px;
            margin-right: 10px;
        }
        .delete-button:hover, .end-session-button:hover {
            background-color: #cc0000;
        }
        .custom-text-error, .custom-text-success {
            font-size: 12px;
            margin-top: 5px;
            display: block;
        }
        .custom-text-error {
            color: red;
        }
        .custom-text-success {
            color: green;
        }
        /* Стили для списка пользователей */
        .user-list {
            margin-top: 20px;
        }
        .user-toggle-button .user-last-visit {
            display: block;
            margin-top: 6px;
            font-size: 12px;
            font-weight: 400;
            color: rgba(255, 255, 255, 0.95);
            opacity: 0.92;
        }
        .user-toggle-button .user-last-visit--empty {
            opacity: 0.75;
            font-style: italic;
        }
        /* Стили для индикатора статуса */
        .status-indicator {
            display: inline-block;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            margin-left: 10px;
            vertical-align: middle;
        }
        .status-online {
            background-color: #28a745;
            animation: status-indicator-online-pulse 3s ease-in-out infinite;
        }
        .status-offline {
            background-color: #6c757d;
        }
        /* Стили для текущей стоимости */
        .gold-price-display {
            margin-bottom: 10px;
            font-size: 16px;
            color: #333;
        }
        /* Адаптивность */
        @media (max-width: 600px) {
            .form-toggle-button, .user-toggle-button {
                padding: 12px;
                font-size: 14px;
            }
            .form-group label, .custom-input, .custom-select, .custom-button, .delete-button, .end-session-button {
                font-size: 14px;
            }
            .gold-price-display {
                font-size: 14px;
            }
            .status-indicator {
                width: 8px;
                height: 8px;
            }
            .custom-text-error, .custom-text-success {
                font-size: 10px;
            }
        }
/* Jewelry Characteristics Panel Styles */

.characteristics-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: transparent;
    border-radius: 8px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0;
    transform: scaleY(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 0;
    overflow: hidden;
    position: relative;
    transform-origin: top;
    scale: 1;
    will-change: transform, opacity, max-height;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.action-buttons-container.expanded-down .characteristics-panel {
    opacity: 1;
    transform: scaleY(1);
    max-height: 1000px;
    scale: 1;
}

/* Remove duplicate characteristics-form styles */


.form-group {
    margin-bottom: 16px;
    min-width: 0;
    flex-shrink: 0;
}

.form-group label {
    display: block;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    flex-shrink: 0;
}

.form-group .checkbox-label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.form-group .checkbox-label input[type="checkbox"] {
    margin-right: 8px;
}


.custom-textarea {
    resize: vertical;
    min-height: 80px;
}

.custom-select {
    cursor: pointer;
}

/* Улучшенный внешний вид для мультивыбора характеристик */
.custom-select[multiple] {
    min-height: 170px;
    padding: 8px;
    border-radius: 8px;
    border-color: #cbd5e1;
    background: #f8fafc;
    line-height: 1.35;
    overflow-y: auto;
}

.custom-select[multiple] option {
    padding: 8px 10px;
    margin: 2px 0;
    border-radius: 6px;
}

.custom-select[multiple] option:checked {
    background: linear-gradient(135deg, #667eea 0%, #7c3aed 100%);
    color: #ffffff;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    flex-shrink: 0;
    margin-top: 24px;
    margin-bottom: 20px;
    padding-top: 16px;
    padding-bottom: 8px;
    border-top: 2px solid #e5e7eb;
}

.save-characteristics-btn, .load-characteristics-btn {
    border: none;
    border-radius: 4px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 120px;
}

.save-characteristics-btn {
    background-color: #10b981;
    color: white;
}

.save-characteristics-btn:hover {
    background-color: #059669;
}

.load-characteristics-btn {
    background-color: #6b7280;
    color: white;
}

.load-characteristics-btn:hover {
    background-color: #4b5563;
}

/* Styles for characteristics management page */
.tabs-navigation {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 24px;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #6b7280;
    position: relative;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: #4F46E5;
    background: none;
}

.tab-button.active:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #4F46E5;
}

.tab-button:hover {
    color: #4F46E5;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.search-controls {
    display: flex;
    align-items: center;
}

/* .form-container стили перенесены выше для раздвигающихся форм */
/* Если нужны стили для других форм, используйте более специфичный селектор */

.data-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

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

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.data-table tr:hover {
    background: #f3f4f6;
}

.edit-btn, .delete-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 8px;
    transition: background-color 0.2s;
}

.edit-btn {
    background: #3b82f6;
    color: white;
}

.edit-btn:hover {
    background: #2563eb;
}

.delete-btn {
    background: #ef4444;
    color: white;
}

.delete-btn:hover {
    background: #dc2626;
}

.article-info {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.article-info h3 {
    margin: 0 0 8px 0;
    color: #1e40af;
}

.article-info p {
    margin: 0;
    color: #374151;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.custom-checkbox {
    margin-right: 8px;
    transform: scale(1.2);
}

/* Responsive styles for characteristics management page */
@media (max-width: 768px) {
    .tabs-navigation {
        flex-direction: column;
    }
    
    .tab-button {
        border-bottom: 1px solid #e5e7eb;
    }
    
    .tab-button:last-child {
        border-bottom: none;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table-container {
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 12px;
    }
    
    .edit-btn, .delete-btn {
        margin-bottom: 4px;
        margin-right: 0;
    }
}

/* Animation for form sections */
.form-section {
    margin-bottom: 24px;
    padding: 16px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s ease-out;
}

.form-section h3 {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: #374151;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    flex-shrink: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Add styles for catalog status indicators */
.catalog-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

.catalog-status.show {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.catalog-status.hide {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Точка у артикула: в каталоге (зелёная) / в jewelry, но не в каталоге (красная) */
.catalog-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
    vertical-align: middle;
}

.catalog-dot--in-catalog {
    background-color: #22c55e;
}

.catalog-dot--jewelry-only {
    background-color: #ef4444;
}
