:root {
    
    --fon:  #444444;
    --fon2: rgba(70, 70, 70, 0.1);
    --box-shadow: 2px 5px 10px rgb(0, 0, 0);
    --btn-color: #0099ffff;
    --btn-red: rgb(255, 28, 28);
    --btn-cancel: rgb(255, 255, 255);
    --btn-hover-color: #40b3ffff;
    --text-color: #ffffff;
    --text-color-2: #e4e4e4;
    --text-color-3: #b1b1b1;
    --sidebar-width: 250px;
    --sidebar-icon-width: 60px;
    --border-bottom: 1px solid #00000069;
    --input: rgba(24, 24, 24, 0.3);
    --border: 1px solid #00000069;
}


* {
    margin: 0;
    padding: 0;
    color: var(--text-color);
    box-sizing: border-box;
    font-family:
        system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial,
        "Noto Sans", "Liberation Sans",
        "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji",
        sans-serif;
        line-height: 1.45;
    -webkit-font-smoothing: antialiased; /* macOS/ios */
    -moz-osx-font-smoothing: grayscale;  /* macOS */
}
html, body { 
    height: 100%; 
}
body{ 
    margin:0; 
    overflow: hidden;
    background: var(--fon);
    -ms-overflow-style: none;       
    scrollbar-width: none;          
}
body::-webkit-scrollbar{ 
    display: none;                  
}

#upload{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,1) url('/img/upload.gif') center no-repeat;
    background-size:50px 50px;
    opacity:0;
    visibility:hidden;
    transition:opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    z-index:99999;
    pointer-events:none; 
}
#upload.show{
    opacity:1;
    visibility:visible;
    pointer-events:auto;  
}

.sun-btn{
    position: absolute;
    top: 5px;
    right: 5px;
    width: 30px;
    height: 30px;
}
.sun-btn img{
    width: 100%;
    height: 100%;
}
.panel-1{
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 350px;
    display:flex; 
    border-radius: 20px;
    z-index: 2;
    flex-direction:column;
    background: var(--fon);
    box-shadow: var(--box-shadow);
}
.panel-1::-webkit-scrollbar{  /* Chrome/Safari/новый Edge */
    display: none;                  /* можно width:0;height:0; */
}
.panel-2{
    display: none;
    position: absolute;
    overflow-y: auto;
    left: 360px;
    border-radius: 0;
    width: 450px;
    top: 0;
    height: 100%;
    z-index: 3;
    border-radius: 20px;
    background: var(--fon);
    box-shadow: var(--box-shadow);
    -ms-overflow-style: none;       
    scrollbar-width: none;          
}
.panel-2::-webkit-scrollbar{ 
    display: none;                  
}
.panel-3{
    display: none;
    position: absolute;
    overflow-y: auto;
    left: 820px;
    border-radius: 0;
    width: 450px;
    top: 0;
    height: 100%;
    z-index: 4;
    border-radius: 20px;
    background: var(--fon);
    box-shadow: var(--box-shadow);
    -ms-overflow-style: none;    
    scrollbar-width: none;
}
.panel-3::-webkit-scrollbar{ 
    display: none;            
}
.thread-search {
    padding:10px; 
    position:sticky; 
    top:0; 
    z-index:1
}
.thread-search input{
    width:100%; 
    background: var(--input); 
    padding-left:10px; 
    height: 34px;
    color: var(--text-color-2); 
    border: none;           /* убрали рамку */
    outline: none;
    border-radius:17px; 
}
@media (max-width: 1290px) {
    .panel-3{
        left: auto;
        right: 0px;
        width: 450px;
    
    }
}
@media (max-width: 830px) {
    .panel-2{
        right: 0px; 
        left: auto;
        width: 450px;
    }
}
@media (max-width: 550px) {
    .panel-1{
        width: 100%;
    }
    .panel-2{
        right: 0px; 
        left: auto;
        width: 100%;
    }
    .panel-3{
        left: auto;
        right: 0px;
        width: 100%;
    }
}
.panel-header{
    border-radius:   20px 20px 0 0;
    position:sticky; top:0; left:0; width:100%; height:50px; z-index:10;
    background: var(--input);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom:1px solid rgba(255,255,255,.25);
}
.panel-header-tittle{
    position: absolute;
    left: 45px;
    top:12px;
    font-size: 13pt;
    display:flex; 
    align-items:center; 
}
.panel-1-item{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-bottom:var(--border);
    cursor: pointer;
}
.back-btn{
    background: none;
    border:none;
    position: absolute;
    top: 8px;
    left: 10px;
    display:flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
/* Создаем стрелку "назад" с помощью CSS */
.back-btn::before {
    content: '';
    width: 12px;
    height: 12px;
    border-left: 2px solid var(--text-color);
    border-bottom: 2px solid var(--text-color);
    transform: rotate(45deg);
    transition: all 0.2s ease;
}
.action-buttons{
    display: flex;
    justify-content: flex-end;
    position: sticky;
    bottom: 20px;
    right: 40px;
}
.btn-cancel{
    background: var(--fon2);
    color: rgb(0, 0, 0);
    border-radius: 17px 0 0 17px;
    border: none;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    height: 35px;
    padding: 0px 20px;
}
.btn-delit{
    background: var(--btn-red);
    color: white;
    border: none;
    height: 35px;
    padding: 0px 20px;
}
.btn-save{
    background: var(--btn-color);
    color: white;
    border-radius: 0 17px 17px 0;
    border: none;
    height: 35px;
    padding: 0px 20px;
}
.activ{
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    position: relative;
    overflow: hidden;
}
/* Стили для отдельных вкладок */
.tab-item {
    /* padding: 5px 20px; */
    font-weight: 500;
    cursor: pointer;
    height: 35px;
    border-radius: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
    justify-content: center;
    align-items: center;
    text-align: center;
    display: flex;
    flex-grow: 1; /* Чтобы кнопки занимали равное пространство */
}
.header-search{
    position: sticky;
    top:0;
    z-index:1;
    width:100%;
    height: 40px;
}
.header-search input{
    width:calc(100% - 50px);
    position: absolute;
    left:10px;
    top:10px;
    padding-left:10px;
    background: var(--input);
    height:34px;
    border-radius:17px;
    border: none;
    outline: none;
}
.header-search-btn{
    position: absolute;
    right:5px;
    top:10px;
    width:34px;
    height:34px;
    border-radius:17px;
    display: flex;
    align-items: center;
}
.header-search-btn img{
    width:100%;
    height:100%;
}
/* Стили для активной вкладки */
.tab-item.active {
    background-color: var(--secondary-color);
    color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
/* Общая структура страницы с товарами */
.tovar-page-container {
    display: flex;
    gap: 20px;
    height: 100vh;
    overflow: hidden;
}

/* Обертка для списка товаров */
.tovar-list-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Заголовки таблицы */
.tovar-list-header {
    display: grid;
    grid-template-columns: 120px 80px 1fr 100px 1fr; /* Определяем ширину колонок */
    padding: 10px;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
    background-color: #f7f7f7;
}

/* Контейнер для скролла */
.tovar-scroll-wrapper {
    overflow-y: auto;
    flex-grow: 1;
}

/* Отдельная строка товара */
.tovar-row {
    display: grid;
    grid-template-columns: 120px 80px 1fr 100px 1fr;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tovar-row:hover {
    background-color: #f9f9f9;
}

.tovar-row.active {
    background-color: #e2f7ff;
}

/* Ячейки */
.tovar-cell {
    padding: 5px;
    display: flex;
    align-items: center;
    font-size: 0.9em;
}

/* Иконка "редактировать" */
.tovar-edit-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.tovar-row.active .tovar-edit-icon {
    transform: rotate(180deg);
}

.tovar-cell-art { text-align: right; }
.tovar-cell-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tovar-cell-price { font-weight: 500; }

.tovar-img-preview {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}

/* Стили для панели редактирования справа */
.tovar-edit-panel {
    width: 0;
    min-width: 0;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transition: width 0.4s ease, min-width 0.4s ease;
    position: relative;
    padding: 0; /* <<<-- Убираем padding, когда блок скрыт */
    overflow-x: hidden; /* <<<-- Добавляем это свойство, чтобы скрыть содержимое */
}

/* Стили для активной панели */
.tovar-edit-panel.active {
    width: 500px;
    min-width: 500px;
    padding: 20px; /* <<<-- Добавляем padding только, когда блок активен */
}

.tovar-edit-close {
    position: absolute;
    top: 0;
    right: 0;
    cursor: pointer;
    /* background-color: #fff; */
    text-align: right;
    font-size: 1.5em;
    padding-bottom: 10px;
    z-index: 10;
}
@media (max-width: 768px) {
    .tovar-edit-panel {
        /* Эти стили нужны для скрытия и позиционирования */
        position: fixed;
        top: 0;
        right: 0;
        height: 100%;
        width: 0;
        min-width: 0;
        z-index: 9999;
        box-shadow: none; /* Убираем тень, когда панель скрыта */
        background: white;
        padding: 0;
    }

    .tovar-edit-panel.active {
        /* Эти стили делают панель видимой только при наличии класса .active */
        width: 100vw !important;
        min-width: 100vw !important;
        box-shadow: -4px 0 16px rgba(0,0,0,0.2);
        padding: 20px !important;
    }

    .tovar-edit-close {
        position: absolute;
        background: none;
        width: 30px;
        height: 30px;
        top: 0;
        right: 15px;
        z-index: 10000;
    }
}

/* Верхний блок (Header) */
.header {
    position: sticky;
    width: 100%;
    height: 50px;
    top:0;
    left:0;
    /* background-color: #fff; */
    color: var(--text-color);
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
}
.logo {
    position: absolute;
    top:10px;
    left:10px;
    font-weight: bold;
    font-size: 17pt;
    color: var(--primary-color);
}

.page-title {
    margin-left: 20px;
    font-size: 1.2em;
    font-weight: 500;
}

.menu-toggle {
    display: none; /* Скрываем по умолчанию */
    background: none;
    border: none;
    position: relative;
    left:10px;
    top:5px;    
    color: var(--secondary-color);
    cursor: pointer;
}
.menu-block{
    z-index: 10;
    position: fixed;
    display: flex;
    bottom: 10px;
    left: 50%;
    padding: 5px 20px 5px 20px;
    background: var(--fon);
    transform: translateX(-50%);
    box-shadow: var(--box-shadow); 
    border-radius: 25px;
  }
.menu-btn{
    display:flex; 
    align-items:center; 
    justify-content:center;
    margin-left: 10px;
    margin-right: 10px;
    border-radius:14px; 
    transition:background .2s, transform .08s;
}
.menu-btn img{ 
    width:40px; 
    height:40px; 
}
.menu-btn:hover{
    transform: translateY(-10px);
    /* background: rgba(255,255,255,0.28);  */
}
.menu-btn:active{ 
    transform: translateY(-15px); 
}

.selected{
    background: rgba(199, 199, 199, 0.3); 
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%); 
}
.fon-1{
    box-shadow: 0 6px 15px rgba(54, 54, 54, 0.6);
    background: rgba(255,255,255,0.2); 
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%); 
}
.fon-2{
    box-shadow: 0 6px 15px rgba(54, 54, 54, 0.6);
    background: rgba(59, 59, 59, 0.6); 
    backdrop-filter: blur(180px) saturate(140%);
    -webkit-backdrop-filter: blur(180px) saturate(140%); 
}
/* Динамический контент */
.dynamic-content {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom:75px;
    z-index: 1;
}
.menu-none{
    display: none;
}
/* Ширина экрана до 1000px */
@media (max-width: 1000px) {
    .menu-none{
        display: block;
    }
    .menu-none-700{
        display: none;

    }
}

/* Ширина экрана до 700px */
@media (max-width: 700px) {
    
   
}

/* Ширина экрана до 500px */
@media (max-width: 500px) {
   
}
.open_shop_new_btn {
    background: var(--btn-color) ;
    position: absolute;
    right: 10px; 
    top: 0;
    height: 35px;
    display: flex;
    color: white;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    font-size: 12pt;
    font-weight: 500;
    padding: 10px 20px;
    transition: transform 0.2s ease;
}

.open_shop_new_btn:hover {
    transform: scale(1.02);
}

.inline-btn-add-open{
    margin-top:5px;
    width: 100%;
    height: 30px;
    resize: vertical;
    display: flex;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    background: var(--input-color);
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s;
    display: flex;
    justify-content: center;
    align-items: center;
}
.post-fileid {
    margin-top:5px;
    width: calc(100% - 20px);
    margin-left: 10px;
    height: 30px;
    border: none;
    resize: vertical;
    border-radius: 8px;
    background: var(--input);
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.post-fileid:focus {
    border-color: var(--secondary-color);
    outline: none;
    background: #fff;
}
.post-textarea {
    width: calc(100% - 20px);
    margin-left: 10px;
    min-height: 150px;
    resize: vertical;
    margin-top:5px;
    border: none;
    border-radius: 8px;
    background: var(--input);
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.post-textarea:focus {
    border-color: var(--secondary-color);
    outline: none;
    background: #fff;
}
.resource-item {
    padding: 5px 10px;
    margin-left: 10px;
    border: 1px solid #aaa;
    border-radius: 5px;
    cursor: pointer;
    display: inline-block;
}
.resource-item.selected {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}
.header-bot{
    display: flex;
    background-color: red;
    justify-content: center;
    align-items: center;
}
.header-bot-img{
    width: 25px;
    height: 25px;
}
.header-bot-name{
    font-size: 14pt;
    margin-left: 5px;
    margin-right: 5px;
    font-weight: 500;
}
.header-bot-back{
    position: absolute;
    right: 0;
    top:8px;
    width: 25px;
    height: 25px;
    transform: rotate(-90deg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    font-size: 28px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--secondary-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.card-title {
    font-size: 16px;
    color: #bbb;
    margin-bottom: 8px;
}

.card-value {
    font-size: 26px;
    font-weight: bold;
    color:  var(--light-text-color);
}
.recent-activity {
    background: var(--secondary-color);
    padding: 20px;
    border-radius: 12px;
    color:  var(--light-text-color);
}

.recent-activity h3 {
    margin-bottom: 15px;
    font-size: 20px;
}

.recent-activity ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-activity li {
    padding: 8px 0;
    border-bottom: 1px solid var(--primary-color);;
}

.token-input-container {
    max-width: 800px;
    margin: 5px auto;
    padding: 20px 30px;
    background: var(--secondary-color);
    border-radius: 16px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3); 
    color: white;
    font-family: 'Segoe UI', sans-serif;
    text-align: center;
}

.token-input-container h2 {
    margin-bottom: 10px;
    font-size: 24px;
    color: var(--light-text-color);
}
.token-description {
    font-size: 14px;
    margin-bottom: 20px;
    color: #cccccc;
}

.token-description a {
    color: var(--btn-hover-color);
    text-decoration: underline;
}

.token-input-container input {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: none;
    border-radius: 10px;
    margin-bottom: 20px;
    background: var(--background-color);
    /* color: white; */
    outline: none;
}

.token-input-container button {
    padding: 12px 20px;
    font-size: 16px;
    border: none;
    border-radius: 10px;
    background-color: var(--btn-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.token-input-container button:hover {
    background-color: var(--btn-hover-color);
}
/* html,body{
    margin:0;
    padding:0;
    background:var(--fon-color);
    color:var(--text-color);
    font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial,sans-serif; } */
    

#sms{
    position:fixed;
    left:50%;
    bottom:30px;
    transform:translateX(-50%);
    z-index:9999999;
    display:flex;
    flex-direction:column;
    align-items:center;
    pointer-events:none;
    width:calc(100% - 20px);
    max-width:820px; }
.sms-message{
    background:#323232;
    color:#fff;
    padding:14px 20px;
    margin-top:8px;
    border-radius:10px;
    box-shadow:0 6px 18px rgba(0,0,0,.25);
    font-size:16px;
    text-align:center;
    opacity:0;
    animation:fadeInOut 4s ease forwards;
    pointer-events:auto;}
@keyframes fadeInOut{
    0%{
        opacity:0;
        transform:translateY(12px)
    }
    10%{
        opacity:1;transform:translateY(0)
    }
    90%{
        opacity:1;
        transform:translateY(0)
    }
    100%{
        opacity:0;
        transform:translateY(12px)
    }}

.auth{
    position:absolute;
    left:20px;
    right:20px;
    top:calc(50% - 140px);
    background:var(--fon-color);
    color:var(--text-color);
    padding:36px 20px 46px;
    border-radius:14px;
    box-shadow:0 8px 30px rgba(0,0,0,.25);
    text-align:center; }
.auth h1{
    margin:0 0 8px;
    font-size:24px}
.auth p{
    margin:0 0 16px;
    opacity:.85}
.auth-tg{
    display:flex;
    justify-content:center;
    align-items:center
}
