/**
 * Стили для компонента управления файлами
 * Вкладки, drag&drop, карточки файлов и товаров
 */

/* Основной контейнер */
.file-management-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: var(--spacing-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.file-management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.file-management-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

/* Область загрузки файлов */
.file-upload-area {
    border: 2px solid var(--border-color);
    border-radius: 3px;
    padding: var(--spacing-md);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    min-width: 200px;
    background: rgba(59, 130, 246, 0.05);
}

.file-upload-area:hover,
.file-upload-area.drag-over {
    border-color: var(--secondary-blue);
    background: rgba(59, 130, 246, 0.1);
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.upload-text {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.upload-subtext {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Вкладки */
.file-tabs {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    background: none;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
}

.tab-button:hover {
    color: var(--text-secondary);
    background: rgba(59, 130, 246, 0.05);
}

.tab-button.active {
    color: var(--secondary-blue);
    background: rgba(59, 130, 246, 0.1);
    border-bottom-color: var(--secondary-blue);
}

/* Контент файлов */
.file-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    flex: 1;
    min-height: 0;
}

/* Область текущего заказа */
.current-order-area {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 3px;
    padding: var(--spacing-md);
    min-height: 300px;
}

.current-order-area h3 {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--success-color);
    font-size: 1rem;
    font-weight: 600;
}

.current-order-content {
    height: calc(100% - 40px);
    overflow-y: auto;
}

/* Список файлов */
.files-list {
    overflow-y: auto;
    max-height: 500px;
    position: relative;
}

/* Закрепленная шапка таблицы */
.files-table {
    position: relative;
}

.files-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Стили для таблицы файлов */
.files-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
    margin: 2px 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border-spacing: 0;
    font-size: 0.6rem;
}

.files-table thead {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-bottom: 2px solid #cbd5e1;
}

.files-table th {
    padding: 4px 6px;
    text-align: left;
    font-weight: 600;
    color: #1e293b;
    border-right: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    font-size: 0.55rem;
    background: rgba(59, 130, 246, 0.08);
    position: relative;
    line-height: 1.1;
}

.files-table th:last-child {
    border-right: none;
}

.files-table th:first-child {
    border-left: none;
}

.files-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.55rem;
    vertical-align: middle;
    background: #ffffff;
    line-height: 1.1;
}

.files-table td:last-child {
    border-right: none;
}

.files-table td:first-child {
    border-left: none;
}

.file-row {
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-row:hover {
    background: rgba(59, 130, 246, 0.05) !important;
}

.file-row:hover td {
    background: rgba(59, 130, 246, 0.05) !important;
}

.file-row:nth-child(even) td {
    background: #f8fafc;
}

.file-row:nth-child(even):hover td {
    background: rgba(59, 130, 246, 0.05) !important;
}

.file-row:last-child td {
    border-bottom: none;
}

.file-row.cancelled {
    opacity: 0.6;
}

.file-row.cancelled .file-name-cell {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Стили для ячеек */
.file-name-cell {
    font-weight: 600;
    color: #1e293b;
    max-width: 200px;
    width: auto;
    position: relative;
    white-space: normal;
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.3;
    padding: 6px 8px;
}

.file-name-cell:hover {
    color: #3b82f6;
}

.file-type-cell {
    text-align: center;
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    position: relative;
}

.type-badge {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
    border: none;
    background: none;
}

.type-badge,
.status-badge {
    text-transform: none;
    letter-spacing: normal;
}

.file-type-cell.type-request .type-badge {
    color: #0277bd;
}

.file-type-cell.type-order .type-badge {
    color: #2e7d32;
}

.file-type-cell.type-reserve .type-badge {
    color: #f57c00;
}

.file-date-cell {
    text-align: center;
    color: #64748b;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

.file-items-cell {
    text-align: center;
    font-weight: 600;
    color: #059669;
    width: 50px;
    min-width: 50px;
    max-width: 50px;
}

.file-sum-cell {
    text-align: right;
    font-weight: 600;
    color: #059669;
    font-family: 'Courier New', monospace;
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

.file-status-cell {
    text-align: center;
    width: 140px;
    min-width: 140px;
    max-width: 140px;
    position: relative;
}

.file-status-cell .status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
    background: none;
    border: none;
}

.file-type-cell.type-request .type-badge {
    color: #0277bd;
}

.file-type-cell.type-order .type-badge {
    color: #2e7d32;
}

.file-type-cell.type-reserve .type-badge {
    color: #f57c00;
}

.status-active .status-badge {
    color: #10b981;
}

.status-pending .status-badge {
    color: #64748b;
    text-transform: none;
    font-weight: normal;
}

.status-cancelled .status-badge {
    color: #ef4444;
}

.status-reserved .status-badge {
    color: #3b82f6;
}

.file-status-cell.type-request .status-badge {
    color: #0277bd;
}

.file-status-cell.type-order .status-badge {
    color: #2e7d32;
}

.file-status-cell.type-reserve .status-badge {
    color: #f57c00;
}

.file-actions-cell {
    text-align: center;
    width: 120px;
    min-width: 120px;
    max-width: 120px;
}

/* Карточка файла */
.file-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    margin-bottom: var(--spacing-md);
    transition: var(--transition);
}

.file-card:hover {
    border-color: var(--secondary-blue);
    background: rgba(255, 255, 255, 0.05);
}

.file-card.cancelled {
    opacity: 0.6;
    text-decoration: line-through;
}

.file-header {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    gap: var(--spacing-sm);
}

.file-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    word-break: break-word;
}

.file-meta {
    display: flex;
    gap: var(--spacing-md);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-actions {
    display: flex;
    gap: var(--spacing-xs);
    flex-shrink: 0;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.action-btn-primary {
    background: var(--secondary-blue);
    color: white;
}

.action-btn-primary:hover {
    background: var(--primary-blue);
}

.action-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.action-btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.action-btn-success {
    background: var(--success-color);
    color: white;
}

.action-btn-success:hover {
    background: #059669;
}

.action-btn-danger {
    background: var(--error-color);
    color: white;
}

.action-btn-danger:hover {
    background: #dc2626;
}

.convert-btn {
    background: var(--secondary-blue);
    color: white;
}

.convert-btn:hover {
    background: var(--primary-blue);
}

.reserve-btn {
    background: var(--success-color);
    color: white;
}

.reserve-btn:hover {
    background: #059669;
}

.cancel-btn {
    background: var(--error-color);
    color: white;
}

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

.restore-btn {
    background: var(--warning-color);
    color: white;
}

.restore-btn:hover {
    background: #d97706;
}

/* Список товаров в файле */
.file-items-list {
    padding: 0 var(--spacing-md) var(--spacing-md);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-sm);
}

/* Карточка товара */
.item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: var(--spacing-sm);
    cursor: grab;
    transition: var(--transition);
}

.item-card:hover {
    border-color: var(--secondary-blue);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.item-card:active {
    cursor: grabbing;
}

.item-card.selected {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.item-card.reserved {
    border-color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
}

.item-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

.item-icon {
    font-size: 0.875rem;
    flex-shrink: 0;
}

.item-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
    word-break: break-word;
}

.item-price {
    font-weight: 600;
    color: var(--secondary-blue);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Пустые состояния */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
    opacity: 0.5;
}

.empty-text {
    font-size: 0.875rem;
}

/* Drag & Drop эффекты */
.drag-over {
    border-color: var(--success-color) !important;
    background: rgba(16, 185, 129, 0.1) !important;
}

.item-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

/* Адаптивность */
@media (max-width: 768px) {
    .file-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .file-management-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .file-upload-area {
        min-width: auto;
    }
    
    .file-tabs {
        flex-wrap: wrap;
    }
    
    .file-items-list {
        grid-template-columns: 1fr;
    }
    
    .file-meta {
        flex-direction: column;
        gap: 2px;
    }
    
    .file-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 2px;
    }
}

/* Анимации */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-card {
    animation: slideIn 0.3s ease-out;
}

/* Стили для отмененных резервов */
.file-card.cancelled .file-name {
    text-decoration: line-through;
    color: var(--text-muted);
}

.file-card.cancelled .file-icon {
    opacity: 0.5;
}

/* Индикаторы статуса */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: var(--spacing-xs);
}

.status-indicator.active {
    background: var(--success-color);
}

.status-indicator.reserved {
    background: var(--warning-color);
}

.status-indicator.cancelled {
    background: var(--error-color);
}

/* Дополнительные стили для drag & drop */
.drop-zone {
    border: 2px solid var(--border-color);
    border-radius: 3px;
    padding: 40px 20px;
    text-align: center;
    background: var(--card-bg);
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 16px;
}

.drop-zone:hover {
    border-color: var(--secondary-blue);
    background: rgba(59, 130, 246, 0.05);
}

.drop-zone.drag-over {
    border-color: var(--secondary-blue);
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.02);
}

.drop-zone-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.drop-zone-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.drop-zone-subtext {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Стили для перетаскиваемых файлов */
.file-card[draggable="true"] {
    cursor: grab;
}

.file-card[draggable="true"]:active {
    cursor: grabbing;
}

/* Стили для индикатора загрузки */
.upload-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-muted);
}

.upload-text {
    margin-top: 12px;
    font-size: 0.9rem;
    text-align: center;
}

.drop-zone.uploading {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--secondary-blue);
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: var(--secondary-blue);
    animation: spin 1s ease-in-out infinite;
}

/* Стили для вкладок */
.file-management-tabs {
    display: flex;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    background: none;
    border: none;
    padding: 10px 15px;
    font-size: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab-button:hover {
    color: var(--text-primary);
}

.tab-button.active {
    color: var(--secondary-blue);
    border-bottom-color: var(--secondary-blue);
    font-weight: 600;
}

.file-management-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    min-height: 0;
}

.file-list-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
}

.file-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    cursor: grab;
}

.file-card:hover {
    border-color: var(--secondary-blue);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.file-card.application-card .file-icon { color: #60a5fa; }
.file-card.order-card .file-icon { color: #10b981; }
.file-card.reserve-card .file-icon { color: #f59e0b; }
.file-card.reserve-card.cancelled .file-icon { color: #ef4444; }

.file-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-name.strikethrough {
    text-decoration: line-through;
    color: var(--text-muted);
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
}

.file-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.file-actions .btn {
    padding: 6px 10px;
    font-size: 0.75rem;
}

/* Заголовки таблицы */
.header-name { width: 25%; }
.header-type { width: 10%; }
.header-date { width: 15%; }
.header-items { width: 10%; }
.header-sum { width: 15%; }
.header-status { width: 10%; }
.header-actions { width: 15%; }

/* Дополнительные стили для красивой таблицы */
.files-table {
    border-spacing: 0;
}

.files-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
}

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

/* Улучшенные стили для кнопок действий */
.file-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
}

.action-btn {
    padding: 3px 6px;
    border: none;
    border-radius: 3px;
    font-size: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 45px;
    line-height: 1;
}

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

.action-btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.action-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.action-btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.action-btn-success {
    background: #10b981;
    color: white;
}

.action-btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

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

.action-btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Стили для текущего заказа */
.current-order-container {
    padding: 8px;
    height: 100%;
    overflow-y: auto;
}

/* Компактная информация о заказе */
.order-info-compact {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 8px 12px;
    margin-bottom: 16px;
    font-size: 0.75rem;
}

.order-info-compact .info-row {
    margin-bottom: 4px;
    line-height: 1.4;
}

.order-info-compact .info-row:last-child {
    margin-bottom: 0;
}

.order-info-compact strong {
    color: #475569;
    font-weight: 600;
}

.order-info-compact .order-status {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-info-compact .order-status.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.order-info-compact .order-status.pending {
    background: rgba(156, 163, 175, 0.15);
    color: #6b7280;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Компактная информация о заказе в две строки */
.order-info-compact-two-rows {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 8px 12px;
    margin-bottom: 16px;
    font-size: 0.75rem;
}

.order-info-compact-two-rows .info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 6px;
    line-height: 1.4;
}

.order-info-compact-two-rows .info-row:last-child {
    margin-bottom: 0;
}

.order-info-compact-two-rows .info-item {
    white-space: nowrap;
    color: #000000;
    font-weight: normal;
}

/* Компактная таблица информации о заказе */
.order-info-table-compact {
    width: 100%;
    border-collapse: collapse;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    margin: 6px 0;
    font-size: 0.6rem;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

.order-info-table-compact td {
    padding: 4px 8px;
}

.order-info-table-vertical {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    margin: 6px 0;
    font-size: 0.6rem;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.order-info-table td {
    padding: 3px 6px;
    border-bottom: 1px solid #f1f5f9;
}

.order-items-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    margin: 6px 0;
    font-size: 0.8rem;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.order-items-table th {
    padding: 4px 6px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-right: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    font-weight: 600;
    color: #1e293b;
    text-align: left;
    font-size: 0.75rem;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.1;
}

.order-items-table th:last-child {
    border-right: none;
}

.order-items-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.75rem;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    vertical-align: middle;
    line-height: 1.1;
}

.order-items-table td:last-child {
    border-right: none;
}

.order-item-row {
    transition: all 0.2s ease;
    cursor: pointer;
}

.order-item-row:hover {
    background: rgba(59, 130, 246, 0.05);
}

.order-item-row:nth-child(odd) {
    background: #ffffff;
}

.order-item-row:nth-child(even) {
    background: #f8fafc;
}

.order-item-row:hover {
    background: rgba(59, 130, 246, 0.08) !important;
}

.item-name-cell {
    font-weight: 600;
    color: #1e293b;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: auto;
}

.item-quantity-cell {
    text-align: center;
    font-weight: 500;
    width: 60px;
    min-width: 60px;
    max-width: 60px;
}

.item-price-cell {
    text-align: right;
    font-weight: 600;
    color: #059669;
    font-family: 'Courier New', monospace;
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

.item-total-cell {
    text-align: right;
    font-weight: 600;
    color: #1e293b;
    font-family: 'Courier New', monospace;
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

.item-actions-cell {
    text-align: center;
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

.item-expand-btn {
    padding: 3px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.item-expand-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #94a3b8;
}

.price-dropdown-row {
    background: #f8fafc !important;
}

.price-dropdown-cell {
    padding: 0 !important;
    border-top: none !important;
}

.price-dropdown-content {
    padding: 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* Адаптивность для таблицы */
@media (max-width: 1200px) {
    .files-table {
        font-size: 0.6rem;
    }
    
    .files-table th,
    .files-table td {
        padding: 4px 6px;
    }
    
    .action-btn {
        padding: 2px 4px;
        font-size: 0.55rem;
        min-width: 40px;
    }
    
    .order-items-table th,
    .order-items-table td {
        padding: 4px 6px;
        font-size: 0.6rem;
    }
    
    .item-expand-btn {
        padding: 2px 4px;
        font-size: 0.55rem;
    }
    
    .order-info-table td {
        padding: 3px 6px;
        font-size: 0.6rem;
    }
}

@media (max-width: 768px) {
    .files-table {
        font-size: 0.65rem;
        margin: 8px 0;
    }
    
    .files-table th,
    .files-table td {
        padding: 4px 6px;
    }
    
    .action-btn {
        padding: 2px 4px;
        font-size: 0.6rem;
        min-width: 40px;
    }
    
    .order-items-table {
        font-size: 0.65rem;
    }
    
    .order-items-table th,
    .order-items-table td {
        padding: 4px 6px;
        font-size: 0.65rem;
    }
    
    .item-expand-btn {
        padding: 2px 4px;
        font-size: 0.6rem;
    }
    
    .order-info-table td {
        padding: 3px 6px;
        font-size: 0.65rem;
    }
    
    .current-order-container {
        padding: 8px;
    }
    
    .order-title {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .items-title {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .files-table {
        font-size: 0.6rem;
        border-radius: 3px;
    }
    
    .files-table th,
    .files-table td {
        padding: 3px 4px;
    }
    
    .action-btn {
        padding: 1px 3px;
        font-size: 0.55rem;
        min-width: 35px;
    }
    
    .order-items-table {
        font-size: 0.6rem;
        border-radius: 3px;
    }
    
    .order-items-table th,
    .order-items-table td {
        padding: 3px 4px;
        font-size: 0.6rem;
    }
    
    .item-expand-btn {
        padding: 1px 3px;
        font-size: 0.55rem;
    }
    
    .order-info-table {
        font-size: 0.6rem;
    }
    
    .order-info-table td {
        padding: 2px 4px;
        font-size: 0.6rem;
    }
    
    .current-order-container {
        padding: 6px;
    }
    
    /* Скрываем некоторые колонки на очень маленьких экранах */
    .file-date-cell,
    .file-items-cell {
        display: none;
    }
    
    .item-total-cell {
        display: none;
    }
}

@media (max-width: 768px) {
    .files-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .file-name-cell {
        max-width: 150px;
    }
    
    .file-actions {
        flex-direction: column;
        gap: 2px;
    }
}

/* Модальное окно действий с файлами */
.file-actions-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.file-actions-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-actions-modal .modal-content {
    background: white;
    border-radius: 3px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.file-actions-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.file-actions-modal .modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.file-actions-modal .close-modal-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.file-actions-modal .close-modal-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.file-actions-modal .modal-body {
    padding: 20px;
}

.file-actions-modal .file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.file-actions-modal .file-info strong {
    font-size: 0.95rem;
    color: #1e293b;
    word-break: break-word;
}

.file-actions-modal .file-type-label {
    font-size: 0.8rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 3px;
    align-self: flex-start;
}

.file-actions-modal .actions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-actions-modal .modal-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.file-actions-modal .modal-action-btn:hover:not(.disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-actions-modal .modal-action-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
}

.file-actions-modal .action-icon {
    font-size: 1.2rem;
    min-width: 20px;
}

.file-actions-modal .action-text {
    font-weight: 500;
    color: #1e293b;
    font-size: 0.9rem;
}

.file-actions-modal .action-description {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.3;
}

.file-actions-modal .modal-action-btn.disabled .action-text,
.file-actions-modal .modal-action-btn.disabled .action-description {
    color: #9ca3af;
}

/* Кнопка меню файла */
.file-menu-btn {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 4px 8px !important;
    min-width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
