body { font-family: sans-serif; margin: 0; background: #121212; color: #fff; user-select: none; overflow: hidden; }
/* ==========================================================================
   НЕВИДИМАЯ ЗОНА МОНИТОРА И ДИНАМИЧЕСКИЕ ТЕНИ ДЛЯ КАРТОЧКИ ЛОГИСТИКИ
   ========================================================================== */

/* Базовый класс для кастомных теней карточки логистики */
.card-logic {
    position: relative;
    border-left: 6px solid #e67e22 !important; /* Оранжевая полоса только слева, как у всех */
    background: #1a1a1a !important;
}

/* Скрытая зона клика (занимает ровно правую треть кнопки) */
.monitor-hidden-zone {
    position: absolute;
    top: 0;
    right: 0;
    width: 33.33%;
    height: 100%;
    z-index: 9999;
    cursor: pointer;
    background: transparent; /* Полностью прозрачная */
}

/* ТЕНИ ПРИ НАВЕДЕНИИ */

/* 1. Если навели на правую треть (на зону монитора) — вся кнопка светится неоново-зеленым */
.card-logic:has(.monitor-hidden-zone:hover) {
    box-shadow: 0 8px 25px rgba(57, 255, 20, 0.4) !important;
}

/* 2. Если навели на саму кнопку (на левые 2/3) — вся кнопка светится оригинальным оранжевым */
.card-logic:hover:not(:has(.monitor-hidden-zone:hover)) {
    box-shadow: 0 8px 25px rgba(230, 126, 34, 0.4) !important;
}

.navbar { position: fixed; top: 0; left: 0; right: 0; height: 50px; background: #1a1a1a; display: flex; align-items: center; padding: 0 10px; z-index: 10000 !important; border-bottom: 1px solid #333; pointer-events: auto !important; }
.menu-item { position: relative; pointer-events: auto !important; }
.menu-btn { background: none; border: none; color: #e67e22; padding: 10px; font-size: 14px; font-weight: bold; text-transform: uppercase; cursor: pointer; }
.dropdown { display: none; position: absolute; top: 50px; left: 0; background: #252525; box-shadow: 0 4px 10px rgba(0,0,0,0.5); border-radius: 4px; z-index: 10001 !important; min-width: 180px; pointer-events: auto !important; }
.dropdown.show { display: block !important; }
.dropdown button, .dropdown a { display: block; width: 100%; padding: 15px; border: none; background: none; text-align: left; text-decoration: none; color: white; border-bottom: 1px solid #333; font-size: 16px; box-sizing: border-box; }
#import-area { display: none; padding: 15px; background: #1a1a1a; border-bottom: 1px solid #333; margin-top: 50px; position: relative; z-index: 500; }
textarea { width: 100%; height: 100px; margin-bottom: 10px; background: #222; color: white; border: 1px solid #444; border-radius: 4px; padding: 8px; box-sizing: border-box; }
.viewport { width: 100vw; height: calc(100vh - 50px); margin-top: 50px; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; position: relative; z-index: 1; }
.viewport::-webkit-scrollbar { display: none; }
.page { flex: 0 0 100vw; height: 100%; scroll-snap-align: start; overflow-y: auto; position: relative; }
table { width: 100%; border-collapse: collapse; background: #000; }
th { background: #1a1a1a; color: #e67e22; padding: 12px 5px; font-size: 12px; position: sticky; top: 0; z-index: 10; border-bottom: 1px solid #e67e22; }
td { padding: 15px 5px; border-bottom: 1px solid #222; text-align: center; color: #fff; font-size: 14px; }
.status-filled { background-color: rgba(46, 204, 113, 0.15) !important; }
.status-bars { margin: 8px 8px 6px; padding: 6px 8px; background: rgba(0,0,0,0.3); border: 1px solid #222; border-radius: 8px; }
.status-bar-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 6px; }
.status-chip { display: inline-flex; align-items: center; gap: 5px; color: #c7c7c7; font-size: 11px; font-weight: 600; flex-grow: 1; flex-basis: 0; justify-content: center;}
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.purple { background: #9b59b6; }
.status-dot.gray { background: #7f8c8d; }
.status-dot.orange { background: #e67e22; }
.status-dot.black { background: #111; border: 1px solid #444; }
.status-progress-track { position: relative; height: 8px; width: 100%; border-radius: 999px; background: #111; overflow: hidden; border: 1px solid #2a2a2a; }
.status-progress-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: linear-gradient(90deg, #f39c12 0%, #e67e22 100%); border-radius: 999px; transition: width 0.2s ease; }
.status-progress-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #f3f3f3; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.selected-row { background-color: rgba(230, 126, 34, 0.3) !important; border-left: 4px solid #e67e22; }
.edit-input { background: #222; color: #fff; border: 1px solid #e67e22; border-radius: 4px; padding: 4px; font-size: 12px; }
.btn-save { background: #27ae60; color: white; border: none; padding: 8px; border-radius: 4px; width: 100%; margin-top: 5px; font-weight: bold;}
.address-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 5px; position: relative; }
.addr-btn { background: #333; color: #fff; border: 1px solid #444; padding: 8px 2px; font-size: 11px; border-radius: 4px; }
.save-row { grid-column: span 4; }
.submenu-container { position: relative; }
.submenu { display: none; position: absolute; top: 0; left: 100%; background: #222; border: 1px solid #444; border-left: 2px solid #e67e22; min-width: 130px; box-shadow: 3px 3px 10px rgba(0,0,0,0.5); z-index: 10; }
.submenu-container.active .submenu { display: block; }
.submenu-trigger { display: flex !important; justify-content: space-between; align-items: center; }
@media screen and (max-width: 480px) { .submenu { position: static; border: none; border-left: 2px solid #e67e22; padding-left: 15px; background: #1a1a1a; box-shadow: none; } }
.menu-item a, .dropdown a, .submenu a { color: #e67e22; text-decoration: none; display: block; }
.dropdown a:hover, .submenu a:hover { background: #333; color: #e67e22; }
.dashboard { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; gap: 20px; background: #111; }
.mode-card { width: 90%; max-width: 450px; padding: 30px; background: #1a1a1a; border-left: 6px solid #7d3f19; border-radius: 12px; text-align: center; text-decoration: none; transition: transform 0.2s, background 0.2s, box-shadow 0.2s; box-shadow: 0 4px 15px rgba(0,0,0,0.5); }
.mode-card:hover { background: #222; transform: translateY(-5px); box-shadow: 0 8px 25px rgba(230, 126, 34, 0.2); }
.mode-card h2 { color: #7d3f19; margin: 0 0 10px 0; font-size: 1.8rem; text-transform: uppercase; }
.mode-card p { color: #888; margin: 0; font-size: 1rem; }
/* ==========================================================================
   КОМПАКТНАЯ СЕТКА ГЛАВНОЙ СТРАНИЦЫ (ИНДЕКС 2x3 С ТОП-ВЕРСИЕЙ)
   ========================================================================== */
.version-tag-top {
    color: #444; /* Тусклый серый цвет, как в оригинале */
    font-family: monospace;
    font-size: 12px;
    letter-spacing: 1px;
    margin-bottom: 25px;
    text-align: center;
    width: 100%;
    text-transform: uppercase;
}

/* Сетка строго 2х3 для главного экрана */
.index-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 450px;
    box-sizing: border-box;
    padding: 0 10px;
}

/* Сброс старой ширины и подгонка высоты */
.index-grid .mode-card {
    width: auto !important;
    margin: 0 !important;
    padding: 20px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
}

.index-grid .mode-card h2 {
    margin: 0;
    font-size: 1.1rem;
}

/* Ограничиваем скрытую зону для логистики */
.index-grid .card-logic .monitor-hidden-zone {
    height: 100%;
    width: 33.33%;
}

/* Кастомный цвет левой полосы для базы данных */
.index-grid .db-card {
    border-left-color: #9b59b6 !important;
}
.back-link { color: #888; text-decoration: none; font-size: 14px; margin-right: 15px; padding: 5px 10px; border: 1px solid #333; border-radius: 4px; transition: 0.2s; }
.back-link:hover { color: #fff; border-color: #e67e22; background: #222; }



.fab-container { 
    position: fixed; 
    bottom: 25px; 
    right: 25px; 
    z-index: 9999; 
}

.lock-btn { 
    width: 64px; /* Чуть увеличим размер под градиент, чтобы размытие шло красиво */
    height: 64px; 
    color: #eee; 
    border: none; 
    border-radius: 50%; 
    font-size: 24px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 0; 
    outline: none; 
    -webkit-tap-highlight-color: transparent; 

    /* Логику цвета убираем из базового фона, теперь тут радиальный туман */
    background: transparent !important; 
    
    /* Оставляем только базовую размытую тень для объема */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
                
    transition: transform 0.1s ease, background 0.1s ease; 
}

/* Эффект при нажатии на ТСД */
.lock-btn:active { align-content:center;   transform: scale(0.9); }



.address-grid .btn-save.save-row { 
    grid-column: span 4; 
    background: #27ae60 !important; 
    color: white !important; 
    border: none; 
    padding: 12px; 
    border-radius: 4px; 
    width: 100%; 
    margin-top: 8px; 
    font-weight: bold; 
    font-size: 14px; 
    cursor: pointer;
    display: block;
    -webkit-appearance: none; 
}
.address-grid .btn-save.save-row:active { background: #2ecc71 !important; transform: scale(0.98); }

.cam-label { display: flex; align-items: center; justify-content: center; background: #1a1a1a; color: #e67e22; border: 1px solid #e67e22; border-radius: 4px; padding: 0 10px; height: 32px; cursor: pointer; font-size: 18px; transition: 0.2s; }
.cam-label:hover { background: #e67e22; color: #fff; }

/* ==========================================================================
   СПЕЦИФИЧНЫЕ СТИЛИ ДЛЯ СТРАНИЦЫ ОТХОДОВ (.waste-page)
   ========================================================================== */

.waste-page .tabs-nav { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 2px solid #333; padding-bottom: 10px; }
.waste-page .tab-btn { flex: 1; padding: 12px; background: #222; border: 1px solid #444; color: #888; border-radius: 6px; cursor: pointer; font-weight: bold; text-transform: uppercase; font-size: 11px; text-align: center; transition: 0.2s; }
.waste-page .tab-btn.active { background: #e67e22; color: #fff; border-color: #e67e22; }
.waste-page .tab-content { display: none; }
.waste-page .tab-content.active { display: block; }

.waste-page .step-alert { padding: 12px; border-radius: 6px; font-weight: bold; text-align: center; font-size: 14px; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.5px; }
.waste-page .step-pallet-waiting { background: #2980b9; color: #fff; border: 1px solid #3498db; }
.waste-page .step-address-waiting { background: #d35400; color: #fff; border: 1px solid #e67e22; animation: waste-pulse 1.5s infinite; }

@keyframes waste-pulse { 0% { opacity: 0.9; } 50% { opacity: 1; } 100% { opacity: 0.9; } }

.waste-page .form-group { margin-bottom: 15px; }
.waste-page .form-group label { display: block; margin-bottom: 5px; font-size: 13px; color: #aaa; font-weight: bold; }
.waste-page .form-group input { width: 100%; padding: 14px; background: #222; border: 1px solid #444; color: #fff; border-radius: 6px; font-size: 16px; box-sizing: border-box; }
.waste-page .form-group input:focus { border-color: #e67e22; outline: none; background: #262626; }
.waste-page .scanner-input-field { border-color: #e67e22 !important; font-size: 18px !important; font-weight: bold; text-align: center; }

.waste-page .btn-action { width: 100%; padding: 15px; border: none; color: #fff; font-size: 15px; font-weight: bold; text-transform: uppercase; border-radius: 6px; cursor: pointer; margin-top: 10px; }
.waste-page .btn-blue { background: #34495e; border: 1px solid #5d6d7e; }
.waste-page .btn-orange { background: #e67e22; }
.waste-page .btn-clear { width: 100%; padding: 8px; background: #222; border: 1px solid #444; color: #888; border-radius: 4px; cursor: pointer; text-transform: uppercase; font-size: 11px; }

.waste-page .history-title { margin-top: 20px; font-size: 13px; color: #aaa; font-weight: bold; border-bottom: 1px solid #333; padding-bottom: 5px; }
.waste-page .log-entry { margin-top: 12px; padding: 12px; background: #111; border-left: 4px solid #3498db; border-radius: 4px; font-family: monospace; font-size: 14px; }
.waste-page .address-type { border-left-color: #2ecc71; }
.waste-page .waste-type { border-left-color: #9b59b6; }
.waste-page .pallet-type { border-left-color: #e67e22; }

.waste-page .badge { padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 11px; text-transform: uppercase; color: #fff; display: inline-block; margin-bottom: 5px; }
.waste-page .bg-addr { background: #2ecc71; }
.waste-page .bg-waste { background: #9b59b6; }
.waste-page .bg-pallet { background: #e67e22; }
.waste-page .bg-unknown { background: #95a5a6; }

#print-area {
    display: none; 
    background: #fff; 
    color: #000; 
    width: 100%; 
    max-width: 450px; 
    box-sizing: border-box; 
    padding: 30px;
    border-radius: 12px; 
    border: 4px dashed #e67e22; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    margin: 20px auto 0 auto;
}

.print-title { font-size: 32px; font-weight: bold; text-transform: uppercase; margin-bottom: 20px; text-align: center; word-break: break-word; }
.qr-container { padding: 10px; background: #fff; border: 1px solid #eee; display: flex; justify-content: center; }
#qrcode-canvas { display: block; max-width: 100% !important; height: auto !important; }
.print-meta { font-size: 22px; font-family: monospace; margin-top: 20px; text-align: center; line-height: 1.4; }
.print-original-text { font-size: 10px; color: #888; margin-top: 20px; font-family: monospace; word-break: break-all; text-align: center; }

/* ==========================================================================
   ЖЕСТКИЕ ПРАВИЛА ДЛЯ ПЕЧАТИ НА А4 (ФИКС БЕЛОГО ЛИСТА + УВЕЛИЧЕННЫЙ QR)
   ========================================================================= */
@media print {
    html, body {
        background: #fff !important;
        color: #000 !important;
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        user-select: auto !important;
    }

    /* Вырубаем всю интерактивную интерфейсную часть сайта */
    .container, .navbar, #import-area, .viewport, .fab-container, .tabs-nav, 
    #placement-tab, #print-tab, #shipping-tab, h2, .form-group, .btn-action, .btn-clear { 
        display: none !important; 
    }
    
    /* Достаем этикетку из скрытия и выводим в нормальный поток печати */
    #print-area {
        display: flex !important; 
        border: none !important; 
        box-shadow: none !important;
        width: 100% !important; 
        max-width: none !important;
        height: auto !important;
        margin: 0 !important;
        padding: 40px !important; 
        position: static !important; 
        visibility: visible !important;
    }

    /* Раздвигаем контейнер под увеличенный QR-код */
    .qr-container {
        padding: 15px !important;
        border: none !important;
    }

    /* Форсируем увеличенный размер QR на печати */
    #qrcode-canvas {
        width: 450px !important;
        height: 450px !important;
        max-width: none !important;
    }

    /* Буст размеров текстов для больших листов */
    .print-title { 
        font-size: 55px !important; 
        color: #000 !important;
        margin-bottom: 35px !important; 
    }
    .print-meta { 
        font-size: 34px !important; 
        color: #000 !important;
        margin-top: 35px !important; 
    }
    .print-original-text {
        color: #555 !important;
        font-size: 14px !important;
    }
}

/* ==========================================================================
   КОМПАКТНАЯ СЕТКА ХАБА (КУБ 2x3 БЕЗ ОПИСАНИЙ)
   ========================================================================== */
.hub-header {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}
.hub-header .back-link {
    display: inline-block;
    margin-bottom: 15px;
}
.hub-header h1 {
    color: #fff;
    font-weight: 300;
}
.hub-header h1 b {
    color: #e67e22;
}

/* Сетка кубика 2х3 для всех экранов */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Строго 2 колонки */
    gap: 12px;
    width: 100%;
    max-width: 450px; /* Ограничиваем ширину, чтобы на ПК кнопки не были слишком растянуты */
    box-sizing: border-box;
    padding: 0 10px;
}

/* Корректировка карточек под компактный вид */
.hub-grid .mode-card {
    width: auto; /* Убираем фиксированную ширину 90% */
    padding: 20px 10px; /* Уменьшаем внутренние отступы */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px; /* Минимальная высота, чтобы кнопки были ухватистыми */
}

.hub-grid .mode-card h2 {
    margin: 0;
    font-size: 1.2rem; /* Слегка уменьшаем шрифт для мобильных */
}

/* Заблокированные карточки */
.mode-card.disabled-card {
    opacity: 0.25;
    border-left-style: dashed !important;
    cursor: not-allowed;
    pointer-events: none;
}
.mode-card.disabled-card h2 {
    color: #555 !important;
}

/* Кнопка "Назад" в самом низу экрана без смещения сетки */
.hub-back-bottom {
    position: absolute;
    top: 150px; /* Отступ от нижнего края экрана */
    left: 50%;
    transform: translateX(-50%); /* Идеальное центрирование по горизонту */
    color: #888;
    text-decoration: none;
    font-size: 13px;
    padding: 8px 16px;
    border: 1px solid #333;
    border-radius: 6px;
    transition: 0.2s;
    font-family: sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hub-back-bottom:hover {
    color: #fff;
    border-color: #e67e22;
    background: #222;
}

/* Чтобы на совсем мелких экранах кнопка не наезжала на кубик */
@media (max-height: 550px) {
    .dashboard {
        padding-bottom: 80px; /* Создаем искусственное место снизу при скролле */
    }
}

/* Родителю поля ввода задаем контекст позиционирования */
#print-tab .form-group {
    position: relative !important;
}

/* Наш кастомный выпадающий список подсказок */
.custom-suggestions-box {
    position: absolute !important;
    top: 100% !important; /* Впритык под инпутом */
    left: 0 !important;
    right: 0 !important;
    background: #222 !important; /* Темный фон под стиль интерфейса */
    border: 1px solid #e67e22 !important; /* Оранжевая рамка */
    border-radius: 0 0 6px 6px !important;
    max-height: 180px !important; /* Ограничиваем высоту, чтобы не уходило под экран */
    overflow-y: auto !important; /* Включаем скролл внутри списка, если подсказок много */
    z-index: 999999 !important; /* Поверх всех окон, кнопок и табов */
    box-shadow: 0 8px 20px rgba(0,0,0,0.8) !important;
}

/* Стили для элементов списка (удобно под палец на ТСД) */
.suggestion-item {
    padding: 12px 15px !important;
    color: #fff !important;
    cursor: pointer !important;
    border-bottom: 1px solid #333 !important;
    font-size: 14px !important;
    text-align: left !important;
    background: #1a1a1a !important;
}

.suggestion-item:last-child {
    border-bottom: none !important;
}

/* Подсветка при наведении или нажатии пальцем */
.suggestion-item:hover, 
.suggestion-item:active {
    background: #e67e22 !important; /* Наш фирменный оранжевый */
    color: #fff !important;
}
/* ==========================================================================
   КНОПКА ПОДДЕРЖКИ В TELEGRAM
   ========================================================================== */
.tg-support-btn {
    position: fixed;
    bottom: 35px; /* Приподняли над системной плавающей панелью/скроллбаром браузера */
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #24A1DE;
    color: #ffffff !important;
    text-decoration: none;
    padding: 12px 24px; /* Слегка увеличили для удобства нажатия пальцем */
    border-radius: 24px;
    font-family: sans-serif;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(36, 161, 222, 0.4);
    transition: transform 0.1s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    z-index: 99999; /* Поверх абсолютно всего */
    pointer-events: auto !important;
}

.tg-support-btn:hover {
    background: #2094cb;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(36, 161, 222, 0.5);
}

.tg-support-btn:active {
    transform: translateX(-50%) translateY(0) scale(0.98);
}

/* Стиль для SVG-значка внутри кнопки */
.tg-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
/* Подсветка строки для кладовщика в режиме просмотра */
.order-table tbody tr.viewer-picked-row {
    background-color: #4a3b5c !important; /* Тускло-фиолетовый */
    color: #e0d0f0 !important; /* Слегка сиреневый текст для читаемости */
}
/* floor.php*/
/* ========================================================================== СПЕЦИФИЧНЫЕ СТИЛИ ДЛЯ РЕЖИМА "ВЫДАЧА С ПОЛА" ========================================================================== */
.floor-body { margin: 0; padding: 0; background: #000; color: #fff; font-family: sans-serif; overflow-y: auto; -webkit-overflow-scrolling: touch; user-select: none; }
.floor-navbar { position: fixed; top: 0; left: 0; right: 0; height: 50px; background: #111; display: flex; align-items: center; padding: 0 10px; border-bottom: 1px solid #333; z-index: 1000; }
.floor-navbar .back-link { color: #888; text-decoration: none; font-size: 14px; margin-right: 15px; padding: 5px 10px; border: 1px solid #333; border-radius: 4px; transition: 0.2s; }
.floor-navbar .back-link:hover { color: #fff; border-color: #e67e22; background: #222; }
.floor-navbar .nav-title { color: #f1c40f; font-weight: bold; font-family: monospace; margin-left: 10px; }
.floor-navbar .finish-btn { background: #2ecc71; color: #000; border: none; padding: 6px 12px; font-weight: bold; border-radius: 4px; cursor: pointer; margin-left: auto; }
.floor-navbar .finish-btn:active { background: #27ae60; }
.floor-form-container { background: #1a1a1a; padding: 15px; border-bottom: 2px solid #333; display: flex; flex-direction: column; gap: 10px; margin-top: 50px; flex-shrink: 0; }
.floor-form-container label { font-size: 11px; color: #888; text-transform: uppercase; }
.floor-form-container input, .floor-form-container select, .floor-form-container button { width: 100%; padding: 12px; background: #222; color: #fff; border: 1px solid #444; border-radius: 6px; font-size: 16px; font-weight: bold; box-sizing: border-box; }
.floor-form-container input:focus { border-color: #e67e22; outline: none; background: #2a2a2a; }
.floor-form-container .submit-btn { background: #e67e22; color: #000; border: none; cursor: pointer; margin-top: 5px; }
.floor-form-container .submit-btn:active { background: #d35400; }
.floor-form-row { display: flex; gap: 10px; }
.floor-form-col { flex: 1; }
.floor-input-wrapper { position: relative; display: flex; align-items: center; width: 100%; }
.floor-input-wrapper input { padding-right: 45px !important; width: 100%; }
.floor-input-wrapper .clear-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 28px !important; height: 28px !important; padding: 0 !important; background: #333 !important; color: #aaa !important; border-radius: 50% !important; display: flex !important; align-items: center !important; justify-content: center !important; font-size: 14px !important; cursor: pointer !important; border: none !important; z-index: 10; }
.floor-status-bars { margin: 8px 8px 6px; padding: 6px 8px; background: rgba(0,0,0,0.3); border: 1px solid #222; border-radius: 8px; }
.floor-status-bar-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 6px; }
.floor-status-chip { display: inline-flex; align-items: center; gap: 5px; color: #c7c7c7; font-size: 11px; font-weight: 600; flex-grow: 1; flex-basis: 0; justify-content: center; }
.floor-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.floor-status-dot.purple { background: #9b59b6; }
.floor-status-dot.gray { background: #7f8c8d; }
.floor-status-dot.orange { background: #e67e22; }
.floor-status-dot.black { background: #111; border: 1px solid #444; }
.floor-progress-track { position: relative; height: 8px; width: 100%; border-radius: 999px; background: #111; overflow: hidden; border: 1px solid #2a2a2a; }
.floor-progress-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: linear-gradient(90deg, #f39c12 0%, #e67e22 100%); border-radius: 999px; transition: width 0.2s ease; }
.floor-progress-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #f3f3f3; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.floor-table-container { padding: 10px; overflow-y: visible; }
.floor-table-main { width: 100%; border-collapse: collapse; font-family: monospace; }
.floor-table-main thead tr { background: #222; color: #888; font-size: 12px; }
.floor-table-main th { padding: 10px; }
.floor-table-main th.th-left { text-align: left; }
.floor-table-main th.th-center { text-align: center; }
.floor-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.8); display: none; align-items: center; justify-content: center; z-index: 2000; }
.floor-modal-content { background: #1a1a1a; border: 1px solid #333; border-radius: 8px; width: 85%; max-width: 300px; padding: 15px; box-sizing: border-box; text-align: center; }
.floor-modal-title { font-size: 14px; color: #888; margin-bottom: 15px; word-break: break-all; }
.floor-modal-btn { width: 100%; padding: 12px; font-size: 16px; font-weight: bold; border: none; border-radius: 6px; cursor: pointer; margin-bottom: 10px; }
.floor-modal-btn.edit { background: #34495e; color: #fff; }
.floor-modal-btn.delete { background: #c0392b; color: #fff; }
.floor-modal-btn.cancel { background: #333; color: #aaa; margin-bottom: 0; }
/* ========================================================================== РЕЖИМ ТСД (tcd.php) ========================================================================== */
.tsd-body { margin: 0; padding: 0; background: #000; color: #fff; font-family: sans-serif; overflow-y: auto; -webkit-overflow-scrolling: touch; user-select: none; }
.tsd-navbar { position: fixed; top: 0; left: 0; right: 0; height: 50px; background: #111; display: flex; align-items: center; padding: 0 10px; border-bottom: 1px solid #333; z-index: 1000; }
.tsd-navbar .back-link { color: #888; text-decoration: none; font-size: 14px; margin-right: 15px; padding: 5px 10px; border: 1px solid #333; border-radius: 4px; transition: 0.2s; }
.tsd-navbar .back-link:hover { color: #fff; border-color: #e67e22; background: #222; }
.tsd-navbar .nav-title { color: #f1c40f; font-weight: bold; font-family: monospace; margin-left: 10px; }
.tsd-navbar .finish-btn { background: #2ecc71; color: #000; border: none; padding: 6px 12px; font-weight: bold; border-radius: 4px; cursor: pointer; margin-left: auto; }
.tsd-navbar .finish-btn:active { background: #27ae60; }
.tsd-scan-zone { background: #1a1a1a; padding: 20px 15px; border-bottom: 2px solid #333; margin-top: 50px; display: flex; flex-direction: column; gap: 8px; }
.tsd-scan-zone label { font-size: 12px; color: #f1c40f; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }
.tsd-input-wrapper { position: relative; display: flex; align-items: center; width: 100%; }
.tsd-input-wrapper input { width: 100%; padding: 15px 45px 15px 15px; background: #222; color: #fff; border: 2px solid #444; border-radius: 8px; font-size: 18px; font-weight: bold; box-sizing: border-box; font-family: monospace; }
.tsd-input-wrapper input:focus { border-color: #e67e22; outline: none; background: #2a2a2a; box-shadow: 0 0 10px rgba(230,126,34,0.2); }
.tsd-input-wrapper .clear-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; padding: 0; background: #333; color: #aaa; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer; border: none; z-index: 10; }
.tsd-status-bars { margin: 8px 8px 6px; padding: 6px 8px; background: rgba(0,0,0,0.3); border: 1px solid #222; border-radius: 8px; }
.tsd-status-bar-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 6px; }
.tsd-status-chip { display: inline-flex; align-items: center; gap: 5px; color: #c7c7c7; font-size: 11px; font-weight: 600; flex-grow: 1; flex-basis: 0; justify-content: center; }
.tsd-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.tsd-status-dot.purple { background: #9b59b6; }
.tsd-status-dot.gray { background: #7f8c8d; }
.tsd-status-dot.orange { background: #e67e22; }
.tsd-status-dot.black { background: #111; border: 1px solid #444; }
.tsd-progress-track { position: relative; height: 8px; width: 100%; border-radius: 999px; background: #111; overflow: hidden; border: 1px solid #2a2a2a; }
.tsd-progress-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: linear-gradient(90deg, #f39c12 0%, #e67e22 100%); border-radius: 999px; transition: width 0.2s ease; }
.tsd-progress-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #f3f3f3; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.tsd-table-container { padding: 10px; overflow-y: visible; }
.tsd-table-main { width: 100%; border-collapse: collapse; font-family: monospace; }
.tsd-table-main thead tr { background: #222; color: #888; font-size: 12px; }
.tsd-table-main th { padding: 10px; }
.tsd-table-main th.th-left { text-align: left; }
.tsd-table-main th.th-center { text-align: center; }
.tsd-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.85); display: none; align-items: center; justify-content: center; z-index: 2000; padding: 5px; } 
.tsd-modal-content { background: #1a1a1a; border: 2px solid #444; border-radius: 12px; width: 100%; max-width: 340px; padding: 12px 15px; box-sizing: border-box; max-height: 96vh; overflow-y: auto; }
.tsd-modal-header { font-size: 12px; color: #888; text-transform: uppercase; margin-bottom: 4px; font-weight: bold; }
.tsd-modal-barcode { font-size: 16px; color: #f1c40f; font-weight: bold; font-family: monospace; margin-bottom: 10px; word-break: break-all; }
.tsd-modal-field { margin-bottom: 8px; display: flex; flex-direction: column; gap: 4px; }
.tsd-modal-field label { font-size: 11px; color: #aaa; text-transform: uppercase; font-weight: 600; }
.tsd-modal-field select, .tsd-modal-field input { width: 100%;  padding: 10px; background: #262626; color: #fff; border: 1px solid #444; border-radius: 6px; font-size: 15px;  font-weight: bold; box-sizing: border-box; }
.tsd-modal-field select:focus { border-color: #e67e22; outline: none; }
.tsd-modal-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; } /* Сжали отступы кнопок */
.tsd-modal-btn { width: 100%; padding: 12px; font-size: 15px; font-weight: bold; border: none; border-radius: 6px; cursor: pointer; } /* Уменьшили кнопки */
.tsd-modal-btn.save { background: #2ecc71; color: #000; }
.tsd-modal-btn.save:active { background: #27ae60; }
.tsd-modal-btn.cancel { background: #333; color: #aaa; }

/* ========================================================================== СКАНИРОВАНИЕ И OCR (КОМПОНЕНТЫ ИЗ ADD.PHP) ========================================================================== */
html.add-html { overflow: auto; height: auto; }
body.add-body { overflow: auto; height: auto; }
#ocr-container { max-width: 850px; margin: 80px auto 40px auto; background: #1e1e1e; padding: 20px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.5); box-sizing: border-box; width: 95%; overflow-y: auto; height: auto; }
#ocr-container h1 { margin-top: 0; color: #00ff66; font-size: 20px; text-align: center; }
#ocr-container .btn-main { background: #00ff66; color: #000; border: none; padding: 15px 20px; font-weight: bold; border-radius: 4px; cursor: pointer; display: block; width: 100%; font-size: 16px; margin-top: 15px; text-align: center; text-decoration: none; box-sizing: border-box; }
#ocr-container .btn-main:disabled { background: #555; color: #aaa; cursor: not-allowed; }
.btn-rotate { background: #3498db; color: #fff; border: none; padding: 10px; font-weight: bold; border-radius: 4px; cursor: pointer; display: block; width: 100%; font-size: 14px; margin-top: 10px; box-sizing: border-box; }
.btn-add-item { background: #27ae60; color: #fff; border: none; padding: 6px 12px; font-size: 13px; font-weight: bold; border-radius: 4px; cursor: pointer; margin: 8px 10px; display: inline-block; }
.btn-delete-item { background: #c0392b; color: #fff; border: none; padding: 6px 10px; font-weight: bold; border-radius: 4px; cursor: pointer; font-size: 13px; }
#ocr-container .status { color: #e67e22; font-style: italic; margin-top: 15px; text-align: center; font-weight: bold; }
#imagePreviewWrapper { margin-top: 15px; text-align: center; display: none; background: #151515; padding: 10px; border-radius: 6px; border: 1px solid #333; }
#imagePreview { max-width: 100%; max-height: 300px; border-radius: 4px; transition: transform 0.2s ease; }
/*===================
#ocr-container .preview-table { width: 100%; border-collapse: collapse; margin-top: 20px; background: #151515; border-radius: 6px; overflow: hidden; }
#ocr-container .preview-table th, #ocr-container .preview-table td { padding: 10px; text-align: left; border-bottom: 1px solid #333; font-size: 14px; }
#ocr-container .preview-table th { background: #222; color: #00ff66; }
=============*/
/* Адаптация tsd-table-main для использования внутри режима создания заявок */
#ocr-container .tsd-table-main { width: 100%; min-width: 580px; }
#ocr-container .tsd-table-main td { padding: 10px 5px; border-bottom: 1px solid #333; font-size: 14px; }
#ocr-container .tsd-table-main td.td-center { text-align: center; }
#ocr-container .tsd-table-main td.td-left { text-align: left; }
#ocr-container .editable-cell:focus { border-color: #e67e22; outline: none; background: #222; }
#ocr-container .editable-cell { background: #2a2a2a; color: #fff; border: 1px solid #444; padding: 8px; border-radius: 4px; font-family: monospace; font-size: 16px; max-width: 100%; box-sizing: border-box; }
.field-c { width: 11ch; }
.field-p { width: 12ch; }
.field-a { width: 100%; min-width: 120px; }
.col-urgent { width: 8%; text-align: center; }
.col-code { width: 22%; }
.col-pallet { width: 22%; }
.col-address { width: 38%; }
.col-actions { width: 10%; text-align: center; }
.urgent-checkbox { width: 20px; height: 20px; cursor: pointer; accent-color: #ff4757; }
#ocr-container .back-btn { color: #aaa; text-decoration: none; display: inline-block; margin-bottom: 15px; font-size: 14px; }
.group-block { border: 1px solid #333; background: #1a1a1a; margin-top: 15px; border-radius: 6px; overflow: hidden; overflow-x: scroll;}
#realtimeMarkdown { width: 100%; height: 200px; background: #111; color: #00ff66; font-family: monospace; font-size: 13px; border: 1px dashed #333; border-radius: 6px; padding: 10px; margin-top: 15px; box-sizing: border-box; resize: none; pointer-events: none; user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; }
