/* ==========================================
   ESTOQUE - TABELAS
   ========================================== */

/* Card da Tabela de Estoque */
.estoque-table-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.estoque-table-card .table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.estoque-table-card .table-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.estoque-table-card .table-header i {
    color: var(--primary-color);
    font-size: 18px;
}

.estoque-table-card .table-actions {
    display: flex;
    gap: 8px;
}

/* Tabela de Estoque */
.estoque-table {
    overflow-x: auto;
}

.estoque-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

.estoque-table thead {
    background: var(--bg-secondary);
}

.estoque-table thead th {
    padding: 16px 20px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.estoque-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.estoque-table tbody tr:hover {
    background: var(--bg-hover);
}

.estoque-table tbody td {
    padding: 16px 20px;
    font-size: 14px;
    color: var(--text-primary);
    vertical-align: middle;
}

/* Código do Produto */
.estoque-table .produto-codigo {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Nome do Produto */
.estoque-table .produto-nome {
    font-weight: 600;
    color: var(--text-primary);
}

/* Categoria Badge */
.estoque-table .categoria-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.estoque-table .categoria-badge.cosmeticos {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.estoque-table .categoria-badge.equipamentos {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.estoque-table .categoria-badge.descartaveis {
    background: rgba(251, 146, 60, 0.1);
    color: #fb923c;
}

.estoque-table .categoria-badge.higiene {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* Quantidade */
.estoque-table .quantidade-col {
    font-weight: 700;
    font-size: 15px;
}

.estoque-table .quantidade-col.critico {
    color: var(--danger-color);
}

.estoque-table .quantidade-col.baixo {
    color: var(--warning-color);
}

.estoque-table .quantidade-col.normal {
    color: var(--success-color);
}

/* Valor */
.estoque-table .valor-col {
    font-weight: 600;
    color: var(--text-primary);
}

/* Status Badge */
.estoque-table .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.estoque-table .status-badge i {
    font-size: 10px;
}

.estoque-table .status-badge.normal {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.estoque-table .status-badge.baixo {
    background: rgba(251, 146, 60, 0.1);
    color: #fb923c;
}

.estoque-table .status-badge.critico {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.estoque-table .status-badge.zerado {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Ações da Tabela */
.estoque-table .table-actions-btns {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.estoque-table .btn-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.estoque-table .btn-action.btn-move {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.estoque-table .btn-action.btn-move:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.1);
}

.estoque-table .btn-action.btn-edit {
    background: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.1);
    color: var(--primary-color);
}

.estoque-table .btn-action.btn-edit:hover {
    background: rgba(var(--primary-r), var(--primary-g), var(--primary-b), 0.2);
    transform: scale(1.1);
}

.estoque-table .btn-action.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.estoque-table .btn-action.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

/* Footer da Tabela */
.estoque-table-card .table-footer,
.movimentacoes-card .card-content .table-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.estoque-table-card .table-info,
.movimentacoes-card .card-content .table-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.estoque-table-card .table-info strong,
.movimentacoes-card .card-content .table-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Paginação */
.estoque-table-card .pagination,
.movimentacoes-card .card-content .pagination {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.estoque-table-card .pagination li {
    margin: 0;
}

.estoque-table-card .pagination .page-link,
.movimentacoes-card .card-content .pagination .page-link {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 12px;
}

.estoque-table-card .pagination .page-link:hover,
.movimentacoes-card .card-content .pagination .page-link:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.estoque-table-card .pagination .page-item.active .page-link,
.movimentacoes-card .card-content .pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.estoque-table-card .pagination .page-item.disabled .page-link,
.movimentacoes-card .card-content .pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tabela de Movimentações */
.movimentacoes-table {
    overflow-x: auto;
}

.movimentacoes-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.movimentacoes-table thead {
    background: var(--bg-secondary);
}

.movimentacoes-table thead th {
    padding: 16px 20px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.movimentacoes-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.movimentacoes-table tbody tr:hover {
    background: var(--bg-hover);
}

.movimentacoes-table tbody td {
    padding: 16px 20px;
    font-size: 14px;
    color: var(--text-primary);
    vertical-align: middle;
}

/* Data/Hora */
.movimentacoes-table .datetime-col {
    font-size: 13px;
}

.movimentacoes-table .datetime-col .date {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
}

.movimentacoes-table .datetime-col .time {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Tipo de Movimentação */
.movimentacoes-table .tipo-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.movimentacoes-table .tipo-badge i {
    font-size: 11px;
}

.movimentacoes-table .tipo-badge.entrada {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.movimentacoes-table .tipo-badge.saida {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.movimentacoes-table .tipo-badge.ajuste {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* Quantidade na Movimentação */
.movimentacoes-table .qtd-col {
    font-weight: 700;
    font-size: 15px;
}

.movimentacoes-table .qtd-col.entrada {
    color: #10b981;
}

.movimentacoes-table .qtd-col.saida {
    color: #ef4444;
}

.movimentacoes-table .qtd-col.ajuste {
    color: #3b82f6;
}

/* Observação */
.movimentacoes-table .obs-col {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Responsividade */
@media (max-width: 768px) {
    .estoque-table-card .table-header,
    .estoque-table-card .table-footer {
        padding: 16px;
    }

    .estoque-table thead th,
    .estoque-table tbody td,
    .movimentacoes-table thead th,
    .movimentacoes-table tbody td {
        padding: 12px 16px;
        font-size: 13px;
    }

    .estoque-table .table-actions-btns {
        flex-wrap: wrap;
    }

    .estoque-table-card .table-footer,
    .movimentacoes-card .card-content .table-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .estoque-table-card .pagination,
    .movimentacoes-card .card-content .pagination {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .estoque-table-card .table-header h5 {
        font-size: 14px;
    }

    .estoque-table,
    .movimentacoes-table {
        font-size: 12px;
    }

    .estoque-table .btn-action {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .estoque-table-card .pagination .page-link,
    .movimentacoes-card .card-content .pagination .page-link {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
        padding: 0 8px;
    }
}
