/**
 * ============================================
 * CSS ESPECÍFICO PARA MÓDULO DE ESTOQUE
 * ============================================
 */

/* Stats Cards Premium */
.stat-card {
    cursor: pointer;
    transform-origin: center;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15) !important;
}

.stat-card:active {
    transform: translateY(-4px) scale(1.01);
}

/* Animação de entrada dos cards */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-grid .stat-card:nth-child(1) {
    animation: slideInUp 0.5s ease-out 0.1s both;
}

.stats-grid .stat-card:nth-child(2) {
    animation: slideInUp 0.5s ease-out 0.2s both;
}

.stats-grid .stat-card:nth-child(3) {
    animation: slideInUp 0.5s ease-out 0.3s both;
}

.stats-grid .stat-card:nth-child(4) {
    animation: slideInUp 0.5s ease-out 0.4s both;
}

/* Badges de Status */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-critical {
    background: #F1B3C2;
    color: #141414;
    box-shadow: 0 2px 8px rgba(241, 179, 194, 0.3);
}

.badge-warning {
    background: #E0F431;
    color: #141414;
    box-shadow: 0 2px 8px rgba(224, 244, 49, 0.3);
}

.badge-success {
    background: #F8F3EB;
    color: #141414;
    border: 2px solid #141414;
}

/* Highlights para números importantes */
.td-number.highlight-blue {
    background-color: rgba(236, 112, 20, 0.1);
    font-weight: 600;
    color: #EC7014;
}

.td-number.highlight-orange {
    background-color: rgba(224, 244, 49, 0.2);
    font-weight: 600;
    color: #141414;
}

.td-number.highlight-purple {
    background-color: rgba(241, 179, 194, 0.2);
    font-weight: 600;
    color: #141414;
}

/* Location Badge */
.location-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #EC7014;
    color: #141414;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Section Badge */
.section-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #E0F431;
    color: #141414;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Section input in modal */
#editSection {
    background: #E0F431 !important;
    color: #141414;
    font-weight: 600;
    text-align: center;
}

/* Product Status Badges */
.product-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge-active {
    background: var(--success-50, #F0FDF4);
    color: #141414;
}

.status-badge-draft {
    background: var(--warning-50, #FFFBEB);
    color: #141414;
}

.status-badge-archived {
    background: var(--neutral-100, #F5F5F5);
    color: #141414;
}

.product-status-badge i {
    font-size: 0.8rem;
}

/* Informações do Produto */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-info strong {
    color: #141414;
    font-size: 0.95rem;
}

.product-info small {
    color: #141414;
    font-size: 0.85rem;
}

/* Tabela de Inventário */
.inventory-row {
    transition: all 0.2s ease;
}

.inventory-row:hover {
    background-color: #F8F3EB;
}

.inventory-row.selected {
    background-color: rgba(236, 112, 20, 0.1);
    border-left: 3px solid #EC7014;
}

/* Checkboxes */
.th-checkbox, .td-checkbox {
    width: 40px;
    text-align: center;
}

.th-checkbox input[type="checkbox"],
.td-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Colunas da tabela */
.th-image, .td-image {
    width: 60px;
    text-align: center;
}

.product-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #F8F3EB;
}

.no-image {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8F3EB;
    border-radius: 8px;
    border: 2px solid #F8F3EB;
    color: #141414;
    font-size: 1.2rem;
}

.td-sku code {
    background: #F8F3EB;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #141414;
    border: 1px solid #F8F3EB;
}

.td-variant {
    font-weight: 500;
    color: #4b5563;
    font-size: 0.9rem;
}

.td-number {
    text-align: center;
    font-weight: 500;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    min-width: 70px;
    white-space: nowrap;
}

/* ===== RESPONSIVIDADE DA TABELA - ENHANCED UX ===== */

/* Container wrapper para scroll horizontal suave */
.card > .card-body {
    padding: 0 !important;
    overflow: hidden;
}

.card-body > div {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    position: relative;
    
    /* Custom scrollbar - Modern Mood Style */
    scrollbar-width: thin;
    scrollbar-color: #EC7014 #F8F3EB;
}

/* Webkit scrollbar premium */
.card-body > div::-webkit-scrollbar {
    height: 12px;
}

.card-body > div::-webkit-scrollbar-track {
    background: linear-gradient(to right, #F8F3EB 0%, #E5E0D8 50%, #F8F3EB 100%);
    border-radius: 6px;
    margin: 0 8px;
}

.card-body > div::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #EC7014 0%, #D96310 100%);
    border-radius: 6px;
    border: 2px solid #F8F3EB;
    box-shadow: 0 2px 8px rgba(236, 112, 20, 0.3);
}

.card-body > div::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #D96310 0%, #C55A0E 100%);
    border-color: #E0F431;
}

.card-body > div::-webkit-scrollbar-thumb:active {
    background: #C55A0E;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Tabela base - otimizada para responsividade */
.table {
    width: 100%;
    min-width: 1950px !important; /* 16 colunas: 50+90+120+180+140+220+130+120+(5×95)+(95+150+130) = 1900px + margem */
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0 !important;
    background: #FFFFFF;
}

/* Header fixo com sticky positioning */
.table thead {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #FFFFFF;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.table thead th {
    background: linear-gradient(135deg, #F8F3EB 0%, #FFFFFF 100%) !important;
    border-bottom: 3px solid #EC7014 !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #141414;
    padding: 1rem 0.75rem !important;
    vertical-align: middle;
}

/* Larguras EXATAS por coluna (16 colunas) */

/* Coluna 1: Checkbox */
.table th:nth-child(1), 
.table td:nth-child(1) {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    text-align: center;
    padding: 0.75rem 0.5rem !important;
}

/* Coluna 2: Imagem */
.table th:nth-child(2), 
.table td:nth-child(2) {
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;
    text-align: center;
    padding: 0.5rem !important;
}

/* Coluna 3: ID Variante */
.table th:nth-child(3), 
.table td:nth-child(3) {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    text-align: center;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #3B82F6;
    font-weight: 600;
}

/* Coluna 4: SKU */
.table th:nth-child(4), 
.table td:nth-child(4) {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
}

/* Coluna 5: Variante */
.table th:nth-child(5), 
.table td:nth-child(5) {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
}

/* Coluna 6: Produto */
.table th:nth-child(6), 
.table td:nth-child(6) {
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
}

/* Coluna 7: Seção */
.table th:nth-child(7), 
.table td:nth-child(7) {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
    text-align: center;
}

/* Coluna 8: Status */
.table th:nth-child(8), 
.table td:nth-child(8) {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    text-align: center;
}

/* Colunas 9-13: Shopify (laranja) - 5 colunas numéricas */
.table th:nth-child(9), .table td:nth-child(9),
.table th:nth-child(10), .table td:nth-child(10),
.table th:nth-child(11), .table td:nth-child(11),
.table th:nth-child(12), .table td:nth-child(12),
.table th:nth-child(13), .table td:nth-child(13) {
    width: 95px !important;
    min-width: 95px !important;
    max-width: 95px !important;
    text-align: center;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

/* Coluna 14: Trânsito (Gestão Interna - amarelo) */
.table th:nth-child(14), 
.table td:nth-child(14) {
    width: 95px !important;
    min-width: 95px !important;
    max-width: 95px !important;
    text-align: center;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-weight: 600;
    color: #0F172A;
}

/* Coluna 15: Local Físico (Gestão Interna - amarelo) */
.table th:nth-child(15), 
.table td:nth-child(15) {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    text-align: center;
    font-weight: 600;
    color: #0F172A;
    font-size: 0.9rem;
}

/* Coluna 16: Ações */
.table th:nth-child(16), 
.table td:nth-child(16) {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
    text-align: center;
    padding: 0.75rem 0.5rem !important;
}

/* Células - comportamento responsivo */
.table td {
    padding: 0.85rem 0.75rem !important;
    vertical-align: middle;
    border-bottom: 1px solid #E5E7EB;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* SKU e Produto com ellipsis */
.td-sku, .td-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.td-sku code {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.td-title strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badges sem quebra */
.section-badge,
.product-status-badge,
.location-badge {
    white-space: nowrap !important;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== UX ENHANCEMENTS ===== */

/* Hover effect nas linhas - Premium */
.inventory-row {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.inventory-row:hover {
    background: linear-gradient(90deg, #FFF9F0 0%, #FFFFFF 100%) !important;
    box-shadow: inset 0 0 0 1px rgba(236, 112, 20, 0.15);
    transform: translateX(2px);
}

.inventory-row:active {
    transform: translateX(0);
}

/* Linha selecionada - destaque premium */
.inventory-row.selected {
    background: linear-gradient(90deg, rgba(236, 112, 20, 0.08) 0%, rgba(236, 112, 20, 0.03) 100%) !important;
    border-left: 4px solid #EC7014 !important;
    box-shadow: inset 0 0 0 1px rgba(236, 112, 20, 0.2);
}

/* Imagens com efeito premium */
.td-image img {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.inventory-row:hover .td-image img {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(236, 112, 20, 0.25) !important;
}

/* Checkboxes estilizados */
input[type="checkbox"] {
    appearance: none;
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #E5E7EB;
    border-radius: 4px;
    background: #FFFFFF;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

input[type="checkbox"]:hover {
    border-color: #EC7014;
    box-shadow: 0 0 0 3px rgba(236, 112, 20, 0.1);
}

input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #EC7014 0%, #D96310 100%);
    border-color: #EC7014;
}

input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: bold;
}

/* Sortable headers - indicador visual */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: all 0.2s ease;
}

.sortable:hover {
    background: rgba(236, 112, 20, 0.05) !important;
    color: #EC7014 !important;
}

.sortable::after {
    content: '⇅';
    opacity: 0.3;
    margin-left: 6px;
    font-size: 0.85em;
    transition: opacity 0.2s ease;
}

.sortable:hover::after {
    opacity: 1;
    color: #EC7014;
}

/* Badges com animação hover */
.section-badge,
.product-status-badge,
.location-badge {
    transition: all 0.2s ease;
}

.inventory-row:hover .section-badge {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(224, 244, 49, 0.4);
}

.inventory-row:hover .product-status-badge {
    transform: scale(1.05);
}

.inventory-row:hover .location-badge {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(236, 112, 20, 0.4);
}

/* Botões de ação - premium style */
.btn-icon {
    background: transparent;
    border: 1px solid transparent;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #6B7280;
    font-size: 0.95rem;
}

.btn-icon:hover {
    background: rgba(236, 112, 20, 0.1);
    border-color: #EC7014;
    color: #EC7014;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 112, 20, 0.2);
}

.btn-icon:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(236, 112, 20, 0.2);
}

/* Loading state para células */
.table td.loading {
    position: relative;
    overflow: hidden;
}

.table td.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(236, 112, 20, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

/* Indicador de scroll disponível */
.card-body > div::before,
.card-body > div::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 12px;
    width: 40px;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-body > div::before {
    left: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.95), transparent);
}

.card-body > div::after {
    right: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.95), transparent);
}

.card-body > div.has-scroll-left::before {
    opacity: 1;
}

.card-body > div.has-scroll-right::after {
    opacity: 1;
}

/* Tooltip nas colunas truncadas */
.td-sku code[title]:hover,
.td-title strong[title]:hover {
    position: relative;
}

/* Header fixo ao fazer scroll - REMOVIDO (já definido acima) */

/* Garantir que SKU não quebre */
.td-sku code {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* Garantir que título não quebre muito */
.td-title .product-info strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* Badges não devem quebrar */
.section-badge,
.product-status-badge,
.location-badge {
    white-space: nowrap;
    display: inline-block;
}

.td-location {
    text-align: center;
}

.td-actions {
    text-align: center;
    width: 100px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin: 0 2px;
    border-radius: 6px;
    color: #141414;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #F8F3EB;
    color: #EC7014;
}

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

/* Filtros */
.filters-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.filters-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #141414;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-input,
.filter-select {
    padding: 10px 12px;
    border: 2px solid #F8F3EB;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #EC7014;
    box-shadow: 0 0 0 3px rgba(236, 112, 20, 0.1);
}

/* Alertas */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

.alert-info {
    background: #F8F3EB;
    color: #141414;
    border-left: 4px solid #EC7014;
}

.alert-info i {
    font-size: 1.2rem;
    color: #EC7014;
}

/* Grid de informações */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 15px;
    background: #F8F3EB;
    border-radius: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item label {
    font-size: 0.85rem;
    color: #141414;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item strong {
    font-size: 1rem;
    color: #141414;
}

/* Histórico */
.history-header {
    padding: 15px;
    background: #EC7014;
    color: #141414;
    border-radius: 8px;
    margin-bottom: 20px;
}

.history-header h4 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
}

.history-header p {
    margin: 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

.history-timeline {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.history-entry {
    background: white;
    border: 2px solid #F8F3EB;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s ease;
}

.history-entry:hover {
    border-color: #EC7014;
    box-shadow: 0 2px 8px rgba(236, 112, 20, 0.1);
}

.history-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #141414;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.history-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-content strong {
    color: #141414;
    font-size: 0.95rem;
}

.history-change {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.old-value {
    background: #F1B3C2;
    color: #141414;
    padding: 4px 8px;
    border-radius: 4px;
}

.new-value {
    background: #E0F431;
    color: #141414;
    padding: 4px 8px;
    border-radius: 4px;
}

.history-change i {
    color: #141414;
}

.history-user {
    color: #141414;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-user i {
    margin-right: 4px;
}

/* Responsive */
@media (max-width: 1200px) {
    .filters-row {
        flex-wrap: wrap;
    }
    
    .filter-group {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 1200px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filters-row {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
}

/* Loading Overlay específico */
#loadingOverlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 15px;
    z-index: 10;
    border-radius: 12px;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid #F8F3EB;
    border-top-color: #EC7014;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Paginação */
.pagination {
    margin-top: 20px;
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pagination-info {
    color: #141414;
    font-size: 0.9rem;
}

.pagination-buttons {
    display: flex;
    gap: 10px;
}

.pagination-buttons .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #E0F431;
    color: #141414;
}

.toast-error {
    border-left: 4px solid #F1B3C2;
    color: #141414;
}

.toast-warning {
    border-left: 4px solid #E0F431;
    color: #141414;
}

.toast-info {
    border-left: 4px solid #EC7014;
    color: #141414;
}

.toast i {
    font-size: 1.2rem;
}

/* Agrupamento visual de colunas */
.table thead th {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 12px 8px;
    white-space: nowrap;
}

.table thead th i {
    margin-right: 4px;
    font-size: 0.9rem;
}

/* Destaque para colunas de gestão interna */
.table tbody td[style*="rgba(224, 244, 49"] {
    font-weight: 500;
}

/* Seções do Modal de Edição */
.modal-content .form-group {
    margin-bottom: 0;
}

.modal-content .form-control[readonly] {
    background: white !important;
    cursor: not-allowed;
    border: 1px solid #dee2e6;
}

.modal-content h4 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-content h4 i {
    font-size: 1rem;
}

/* Seção Shopify - Laranja */
.modal-content > div[style*="rgba(236, 112, 20"] {
    transition: all 0.3s ease;
}

.modal-content > div[style*="rgba(236, 112, 20"]:hover {
    background: rgba(236, 112, 20, 0.08) !important;
}

/* Seção Gestão Interna - Lime */
.modal-content > div[style*="rgba(224, 244, 49"] {
    transition: all 0.3s ease;
}

.modal-content > div[style*="rgba(224, 244, 49"]:hover {
    background: rgba(224, 244, 49, 0.08) !important;
}

/* Link do Shopify */
#shopifyLink {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(236, 112, 20, 0.3);
}

#shopifyLink:hover {
    background: #d96412 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 112, 20, 0.4);
}

#shopifyLink i {
    margin-right: 6px;
}

/* Responsivo - scroll horizontal */
@media (max-width: 1400px) {
    .table {
        font-size: 0.9rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 8px 6px;
    }
}

/* ============================================
   RESPONSIVIDADE MOBILE
   ============================================ */

/* Stats Grid */
.stats-grid {
    transition: all 0.3s ease;
}

.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Filters Grid */
.filters-grid {
    transition: all 0.3s ease;
}

.filters-card .form-group {
    transition: all 0.3s ease;
}

/* Tablets e menores */
@media (max-width: 992px) {
    /* Grid de estatísticas - 2 colunas */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
    }
    
    /* Filtros - stack vertical */
    .card .form-group {
        margin-bottom: 1rem;
    }
    
    /* Tabela com scroll horizontal */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 1200px;
        font-size: 0.85rem;
    }
    
    /* Modal - ajustar padding */
    .modal-content {
        padding: 1.5rem;
    }
    
    .modal-content > div[style*="display: grid"] {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.75rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Page header */
    .page-header {
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .page-header-content {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .page-header h2 {
        font-size: 1.25rem;
    }
    
    .page-header .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        width: 100%;
    }
    
    /* Grid de estatísticas - 2 colunas no mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }
    
    /* Cards de estatísticas */
    .stat-card {
        margin-bottom: 0;
        padding: 0.875rem !important;
    }
    
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem !important;
    }
    
    .stat-label {
        font-size: 0.7rem !important;
    }
    
    /* Filtros */
    .filters-card {
        padding: 0.75rem;
        margin: 0 0 1rem 0;
    }
    
    .filters-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    
    .filters-section {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .filters-section h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
    
    .form-control {
        font-size: 0.875rem;
        padding: 0.625rem;
    }
    
    /* Botões de ação */
    .btn {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
    }
    
    .btn-block {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Card de listagem */
    .card {
        margin: 0 0 1rem 0;
        border-radius: 8px;
    }
    
    .card-header {
        padding: 0.875rem 1rem !important;
        flex-wrap: wrap;
    }
    
    .card-title {
        font-size: 1rem !important;
        flex: 1 1 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Tabela responsiva */
    .inventory-table-container {
        overflow-x: auto;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .inventory-table {
        font-size: 0.75rem;
    }
    
    .inventory-table th,
    .inventory-table td {
        padding: 0.5rem 0.375rem !important;
        white-space: nowrap;
    }
    
    /* Imagens menores */
    .product-image {
        width: 36px !important;
        height: 36px !important;
    }
    
    /* Badges menores */
    .badge,
    .status-badge,
    .alert-badge,
    .location-badge {
        font-size: 0.7rem !important;
        padding: 0.25rem 0.4rem !important;
    }
    
    /* Botões de ação menores */
    .btn-sm,
    .btn-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.875rem !important;
        padding: 0.375rem !important;
    }
    
    /* Modais tela cheia no mobile */
    .modal-dialog {
        max-width: 95% !important;
        margin: 0.5rem !important;
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 1rem !important;
    }
    
    .modal-title {
        font-size: 1.125rem !important;
    }
    
    .modal-body {
        padding: 1rem !important;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 1rem !important;
        flex-wrap: wrap;
    }
    
    .modal-footer .btn {
        flex: 1;
        min-width: 120px;
    }
    
    /* Tabela */
    .table {
        font-size: 0.75rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 6px 4px;
    }
    
    .table thead th i {
        display: none; /* Ocultar ícones no mobile para economizar espaço */
    }
    
    /* Paginação */
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .pagination button {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    /* Modal - tela cheia no mobile */
    .modal {
        padding: 0;
    }
    
    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        padding: 1rem;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 1rem 0;
        margin-bottom: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 0;
    }
    
    /* Grid do modal - 2 colunas */
    .modal-content > div[style*="display: grid"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
    }
    
    .modal-content .form-group {
        margin-bottom: 0.5rem;
    }
    
    .modal-content label {
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }
    
    .modal-content .form-control,
    .modal-content input,
    .modal-content textarea {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
        padding-top: 1rem;
        margin-top: 1rem;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Histórico modal */
    #historyModal .timeline {
        padding-left: 1rem;
    }
    
    #historyModal .timeline-item {
        padding-left: 1.5rem;
    }
}

/* Mobile pequeno */
@media (max-width: 480px) {
    /* Estatísticas em coluna única */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Header simplificado */
    .page-header h2 {
        font-size: 1.125rem;
    }
    
    .page-title {
        font-size: 1.125rem !important;
    }
    
    /* Botões empilhados */
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .header-actions .btn {
        width: 100%;
    }
    
    /* Cards */
    .stat-card {
        padding: 0.75rem !important;
    }
    
    .stat-value {
        font-size: 1.25rem !important;
    }
    
    .stat-label {
        font-size: 0.65rem !important;
    }
    
    /* Filtros */
    .filters-section {
        padding: 0.875rem;
    }
    
    /* Tabela */
    .inventory-table {
        font-size: 0.7rem;
    }
    
    .inventory-table th,
    .inventory-table td {
        padding: 0.375rem 0.25rem !important;
    }
    
    /* Imagens ainda menores */
    .product-image {
        width: 32px !important;
        height: 32px !important;
    }
    
    /* Badges */
    .badge,
    .status-badge,
    .alert-badge {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.35rem !important;
    }
    
    /* Botões */
    .btn-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.75rem !important;
    }
    
    /* Modal */
    .modal-dialog {
        margin: 0.25rem !important;
        max-width: calc(100% - 0.5rem) !important;
    }
    
    .modal-title {
        font-size: 1rem !important;
    }
    
    .modal-body {
        padding: 0.875rem !important;
    }
    
    .form-group {
        margin-bottom: 0.625rem;
    }
    
    .form-control {
        font-size: 0.8125rem;
        padding: 0.5rem;
    }
    
    /* Seções do modal bulk edit */
    .bulk-edit-section {
        padding: 0.875rem !important;
        margin-bottom: 0.75rem;
    }
    
    .bulk-edit-section h4 {
        font-size: 0.875rem !important;
    }
    
    /* Checkboxes e labels */
    input[type="checkbox"] {
        width: 18px !important;
        height: 18px !important;
    }
    
    label {
        font-size: 0.8125rem !important;
    }
    
    /* Botões do modal footer */
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.75rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem !important;
    }
    
    .stat-card p {
        font-size: 0.75rem !important;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Melhorias de UX */
@media (hover: none) and (pointer: coarse) {
    /* Touch devices */
    .table tbody tr {
        cursor: pointer;
    }
    
    .table tbody tr:active {
        background-color: rgba(236, 112, 20, 0.1);
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    /* Aumentar área de toque dos checkboxes */
    input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }
    
    /* Aumentar área de toque dos botões */
    .btn {
        min-height: 44px; /* iOS recomenda 44x44 */
    }
}

/* Print styles */
@media print {
    .sidebar,
    .filters-section,
    .modal,
    .btn,
    .pagination {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .table {
        font-size: 10pt;
    }
    
    .page-header {
        page-break-after: avoid;
    }
}

/* ===================================
   BULK EDIT MODAL ENHANCEMENTS
   =================================== */

/* Bulk edit checkboxes with better interaction */
#bulkEditForm input[type="checkbox"] {
    cursor: pointer;
    transition: all 0.2s ease;
}

#bulkEditForm input[type="checkbox"]:hover {
    transform: scale(1.1);
}

#bulkEditForm input[type="checkbox"]:checked {
    filter: drop-shadow(0 0 4px rgba(224, 244, 49, 0.6));
}

/* Bulk edit form group hover effect */
#bulkEditForm .form-group {
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 6px;
}

#bulkEditForm .form-group:hover {
    background: rgba(236, 112, 20, 0.03);
}

/* Bulk edit labels with checkbox */
#bulkEditForm label {
    transition: all 0.2s ease;
}

#bulkEditForm label:hover {
    color: #EC7014;
}

/* Disabled state for inputs */
#bulkEditForm input:disabled,
#bulkEditForm textarea:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

#bulkEditForm input:not(:disabled),
#bulkEditForm textarea:not(:disabled) {
    border: 2px solid #E0F431;
    background: white;
}

#bulkEditForm input:not(:disabled):focus,
#bulkEditForm textarea:not(:disabled):focus {
    outline: none;
    border-color: #EC7014;
    box-shadow: 0 0 0 3px rgba(236, 112, 20, 0.1);
}

/* Info banner animation */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(236, 112, 20, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(236, 112, 20, 0.5);
    }
}

#bulkEditModal .modal-body > div:first-child {
    animation: pulse-glow 3s ease-in-out infinite;
}

/* Section headers in bulk edit */
#bulkEditForm h4 {
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

#bulkEditForm h4 i {
    font-size: 1.1rem;
}

/* Small helper text */
#bulkEditForm small {
    line-height: 1.4;
}

/* ===================================
   END BULK EDIT ENHANCEMENTS
   =================================== */

/* ===================================
   MEDIA QUERIES - RESPONSIVIDADE MOBILE
   =================================== */

/* Tablets e dispositivos médios (768px - 1024px) */
@media (max-width: 1024px) {
    /* Stats grid - 2 colunas em tablets */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    /* Botões de ação - wrap responsivo */
    .page-header + div {
        flex-wrap: wrap;
    }
    
    /* Filtros - stack vertical */
    .filters-container {
        flex-direction: column !important;
    }
    
    .filters-container > div {
        width: 100% !important;
    }
    
    /* Reduzir fonte dos headers */
    .table thead th {
        font-size: 0.7rem !important;
        padding: 0.75rem 0.5rem !important;
    }
    
    /* Scrollbar mais fino */
    .card-body > div::-webkit-scrollbar {
        height: 6px !important;
    }
}

/* Smartphones e dispositivos pequenos (max-width: 767px) */
@media (max-width: 767px) {
    /* Header da página */
    .page-header h2 {
        font-size: 1.5rem !important;
    }
    
    .page-header p {
        font-size: 0.85rem !important;
    }
    
    /* Stats grid - 1 coluna em mobile */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .stat-card .card-body {
        padding: 1.25rem !important;
    }
    
    .stat-card h3 {
        font-size: 1.75rem !important;
    }
    
    /* Botões compactos */
    .btn {
        padding: 0.5rem 0.875rem !important;
        font-size: 0.85rem !important;
    }
    
    .btn-icon {
        padding: 6px 10px !important;
        font-size: 0.85rem !important;
    }
    
    /* Tabela - ajustes mobile */
    .table {
        min-width: 1600px !important; /* Reduz largura mínima para mobile */
    }
    
    .table thead th {
        font-size: 0.65rem !important;
        padding: 0.65rem 0.4rem !important;
    }
    
    .table td {
        font-size: 0.8rem !important;
        padding: 0.7rem 0.5rem !important;
    }
    
    /* Imagens menores */
    .td-image img {
        width: 40px !important;
        height: 40px !important;
    }
    
    /* Badges compactos */
    .badge,
    .section-badge,
    .product-status-badge,
    .location-badge {
        font-size: 0.7rem !important;
        padding: 3px 6px !important;
    }
    
    /* Scrollbar ainda mais fino */
    .card-body > div::-webkit-scrollbar {
        height: 4px !important;
    }
    
    /* Paginação - stack vertical */
    .page-header + div + div + div + div + div {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    #pageInfo {
        text-align: center;
        margin-bottom: 0.75rem;
    }
    
    /* Modal - fullscreen em mobile */
    .modal {
        padding: 0 !important;
    }
    
    .modal-dialog {
        margin: 0 !important;
        max-width: 100% !important;
        height: 100vh;
        display: flex;
        align-items: center;
    }
    
    .modal-content {
        border-radius: 0 !important;
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 1rem !important;
    }
    
    .modal-title {
        font-size: 1.1rem !important;
    }
    
    .modal-body {
        padding: 1rem !important;
    }
    
    .form-group {
        margin-bottom: 0.875rem;
    }
    
    .form-label {
        font-size: 0.85rem !important;
    }
    
    .form-control {
        font-size: 0.9rem !important;
        padding: 0.625rem !important;
    }
}

/* Dispositivos muito pequenos (max-width: 480px) */
@media (max-width: 480px) {
    /* Header ultra compacto */
    .page-header {
        margin-bottom: 1.25rem !important;
    }
    
    .page-header h2 {
        font-size: 1.25rem !important;
    }
    
    .page-header h2 i {
        font-size: 1rem !important;
    }
    
    /* Stats ainda mais compactos */
    .stat-card h3 {
        font-size: 1.5rem !important;
    }
    
    .stat-card p {
        font-size: 0.65rem !important;
    }
    
    .stat-card .card-body > div > div:last-child {
        width: 48px !important;
        height: 48px !important;
    }
    
    .stat-card .card-body > div > div:last-child i {
        font-size: 1.5rem !important;
    }
    
    /* Botões empilhados */
    .page-header + div {
        flex-direction: column !important;
    }
    
    .page-header + div button {
        width: 100% !important;
    }
    
    /* Tabela ultra compacta */
    .table {
        min-width: 1400px !important;
    }
    
    .table thead th {
        font-size: 0.6rem !important;
        padding: 0.5rem 0.3rem !important;
    }
    
    .table td {
        font-size: 0.75rem !important;
        padding: 0.6rem 0.4rem !important;
    }
    
    /* Checkbox menor */
    input[type="checkbox"] {
        width: 16px !important;
        height: 16px !important;
    }
    
    /* Imagens ainda menores */
    .td-image img {
        width: 35px !important;
        height: 35px !important;
    }
    
    /* Botões de ação compactos */
    .btn-icon {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }
}

/* Touch-friendly improvements para todos os dispositivos touch */
@media (hover: none) and (pointer: coarse) {
    /* Aumenta áreas de toque */
    .btn,
    .btn-icon,
    input[type="checkbox"],
    .sortable {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects que não funcionam bem em touch */
    .inventory-row:hover {
        background: transparent !important;
        transform: none !important;
    }
    
    /* Active state para feedback tátil */
    .inventory-row:active {
        background: rgba(236, 112, 20, 0.05) !important;
    }
    
    .btn:active,
    .btn-icon:active {
        transform: scale(0.95);
    }
    
    /* Scroll mais suave */
    .card-body > div {
        scroll-behavior: smooth;
    }
}

/* Dark mode support (futuro) */
@media (prefers-color-scheme: dark) {
    /* Placeholder para dark mode */
    /* A ser implementado futuramente */
}

/* Reduzir movimentos para usuários com preferência de acessibilidade */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===================================
   END MEDIA QUERIES
   =================================== */
