/* ===== ADMIN PRODUCTS TABLE STYLES ===== */

/* Улучшенное отображение категорий и статусов */
.modern-table td {
    vertical-align: middle;
}

/* Категория - с переносом текста */
.modern-table td:nth-child(5) {
    max-width: 150px;
    white-space: normal !important;
    word-wrap: break-word;
    line-height: 1.4;
}

/* Статус - бейдж с переносом */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
}

.status-completed {
    background: #d1e7dd;
    color: #0f5132;
}

.status-cancelled {
    background: #f8d7da;
    color: #842029;
}

/* Кнопки действий - компактные */
.modern-table .flex.gap-1 {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: center;
}

.modern-table .btn-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modern-table .btn-sm i {
    font-size: 0.9rem;
}

.modern-table .btn-outline {
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
}

.modern-table .btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 118, 86, 0.05);
}

.modern-table .btn-danger {
    border: 1px solid #dc3545;
    background: var(--bg-card);
    color: #dc3545;
}

.modern-table .btn-danger:hover {
    background: #dc3545;
    color: white;
}

/* Улучшенное отображение длинных названий */
.modern-table td:nth-child(4) {
    max-width: 250px;
    white-space: normal !important;
    word-wrap: break-word;
    line-height: 1.3;
}

/* Артикул - моноширинный шрифт */
.modern-table td:nth-child(3) {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Цена - выделение */
.modern-table td:nth-child(6) {
    font-weight: 700;
    color: var(--primary);
}

/* Мобильная адаптация */
@media (max-width: 767px) {
    /* Категория - еще более компактная */
    .modern-table td:nth-child(5) {
        max-width: 120px;
        font-size: 0.8rem;
    }
    
    /* Название - компактнее */
    .modern-table td:nth-child(4) {
        max-width: 180px;
        font-size: 0.85rem;
    }
    
    /* Статус - меньший размер */
    .status-badge {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    /* Кнопки - только иконки */
    .modern-table .btn-sm {
        padding: 6px;
        min-width: 32px;
        min-height: 32px;
    }
    
    .modern-table .btn-sm i {
        font-size: 0.85rem;
    }
    
    /* Увеличиваем минимальную ширину таблицы для прокрутки */
    table.modern-table {
        min-width: 800px !important;
    }
}

/* Очень маленькие экраны */
@media (max-width: 479px) {
    .modern-table td:nth-child(5) {
        max-width: 100px;
        font-size: 0.75rem;
    }
    
    .modern-table td:nth-child(4) {
        max-width: 150px;
        font-size: 0.8rem;
    }
    
    .modern-table .btn-sm {
        padding: 4px;
        min-width: 28px;
        min-height: 28px;
    }
}

/* Десктоп - оптимальные размеры */
@media (min-width: 768px) {
    .modern-table td:nth-child(5) {
        max-width: 200px;
    }
    
    .modern-table td:nth-child(4) {
        max-width: 300px;
    }
}

/* ===== PRODUCT IMAGE UPLOAD (admin/manager modal) ===== */
.product-image-field {
    margin-bottom: 16px;
}

.product-image-upload-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px 14px;
    max-width: 280px;
    border: 2px dashed var(--border, #d1d5db);
    border-radius: 10px;
    background: linear-gradient(180deg, var(--bg-page, #f8fafc) 0%, var(--bg-card, #fff) 100%);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
    outline: none;
}

.product-image-upload-zone:hover,
.product-image-upload-zone:focus-visible {
    border-color: var(--primary, #007656);
    background: linear-gradient(180deg, rgba(0, 118, 86, 0.06) 0%, var(--bg-card, #fff) 100%);
    box-shadow: 0 8px 24px rgba(0, 118, 86, 0.12);
}

.product-image-upload-zone.is-dragover {
    border-color: var(--primary, #007656);
    border-style: solid;
    background: rgba(0, 118, 86, 0.08);
    transform: scale(1.01);
}

.product-image-upload-zone.is-uploading {
    pointer-events: none;
    opacity: 0.75;
}

.product-image-upload-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 118, 86, 0.1);
    color: var(--primary, #007656);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.product-image-upload-title {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-main, #111827);
    margin-bottom: 2px;
}

.product-image-upload-sub {
    font-size: 0.8rem;
    color: var(--text-secondary, #6b7280);
}

.product-image-browse-link {
    color: var(--primary, #007656);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.product-image-upload-hint {
    margin-top: 6px;
    font-size: 0.68rem;
    color: var(--text-tertiary, #9ca3af);
}

.product-image-file-name {
    margin-top: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary, #007656);
    word-break: break-all;
    max-width: 100%;
}

.product-image-preview-wrap {
    position: relative;
    display: inline-block;
    margin-top: 14px;
    padding: 10px;
    background: var(--bg-page, #f8fafc);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
}

.product-image-preview-wrap img {
    display: block;
    max-height: 112px;
    max-width: 100%;
    border-radius: 8px;
    object-fit: contain;
}

.product-image-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.product-image-remove-btn:hover {
    background: var(--danger, #dc2626);
}

.product-image-url-label {
    margin-top: 14px !important;
    font-size: 0.85rem;
}
