/* ===== CONTAINER ===== */
.matriz-container {
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e0e0e0;
}

.matriz-scroll {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 70vh;
}

/* ===== TABELA ===== */
.matriz-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

/* ===== HEADER ===== */
.matriz-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

.matriz-table thead th {
    background: #2d3748;
    color: #fff;
    font-weight: 600;
    padding: 12px 8px;
    text-align: center;
    border-bottom: 2px solid #F06716;
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.col-produto-header {
    text-align: left !important;
    padding-left: 10px !important;
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    position: sticky;
    left: 0;
    z-index: 25;
    background: #2d3748 !important;
}

.col-emb-header,
.col-und-header {
    width: 35px;
    min-width: 35px;
    max-width: 35px;
    padding: 12px 2px !important;
    font-size: 10px !important;
}

.col-preco-header {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    padding: 12px 2px !important;
    font-size: 10px !important;
}

.col-loja-header {
    min-width: 100px;
    max-width: 120px;
}

.loja-header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.loja-icon {
    color: #F06716;
}

.loja-nome {
    font-size: 10px;
    font-weight: 600;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loja-cnpj {
    font-size: 8px;
    opacity: 0.7;
    font-weight: 400;
}

.col-total-header {
    min-width: 80px;
    background: #1a5235 !important;
}

/* ===== FORNECEDOR ROW ===== */
.fornecedor-row {
    background: #f1f5f9;
}

.fornecedor-row td {
    padding: 10px 8px;
    border-bottom: 1px solid #cbd5e1;
    font-weight: 600;
    color: #1e293b;
    font-size: 13px;
    text-transform: uppercase;
}

.col-fornecedor-nome {
    text-align: left;
    padding-left: 10px !important;
    position: sticky;
    left: 0;
    background: #f1f5f9;
    z-index: 10;
    width: 350px;
    min-width: 350px;
    max-width: 350px;
}

.col-fornecedor-cell {
    background: #f1f5f9;
}

.col-fornecedor-total {
    text-align: center;
    background: #e2e8f0;
    color: #0f172a;
}

/* ===== PRODUTO ROW ===== */
.produto-row {
    background: #fff;
}

.produto-row:nth-child(even) {
    background: #fafafa;
}

.produto-row:hover {
    background: #eff6ff !important;
}

.produto-row td {
    padding: 8px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.col-produto-nome {
    text-align: left;
    padding-left: 20px !important;
    font-weight: 500;
    color: #374151;
    position: sticky;
    left: 0;
    background: inherit;
    z-index: 10;
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.produto-row:nth-child(even) .col-produto-nome {
    background: #fafafa;
}

.produto-row:hover .col-produto-nome {
    background: #eff6ff !important;
}

.col-emb-valor {
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    padding: 8px 8px 8px 2px !important;
    width: 45px;
    min-width: 45px;
    max-width: 45px;
}

.col-und-valor {
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    padding: 8px 2px !important;
    width: 35px;
    min-width: 35px;
    max-width: 35px;
}

.col-emb-edit {
    text-align: center;
    vertical-align: middle;
    padding: 4px 2px !important;
    width: 75px;
    min-width: 75px;
    max-width: 75px;
}

.col-preco-edit {
    text-align: center;
    vertical-align: middle;
    padding: 4px 2px !important;
    width: 90px;
    min-width: 90px;
    max-width: 90px;
}

.col-quantidade {
    text-align: center;
    vertical-align: middle;
    padding: 4px !important;
}

.col-quantidade .mud-input-control,
.col-quantidade .mud-field,
.col-quantidade > div {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

/* ===== INPUTS ===== */
.input-qtd {
    width: 65px;
}

.input-qtd input {
    text-align: center !important;
    font-weight: 600;
    font-size: 13px;
    padding: 6px 4px !important;
}

.input-emb {
    width: 70px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.input-emb input {
    text-align: center !important;
    font-size: 11px;
    padding: 6px 2px !important;
}

.input-preco {
    width: 85px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.input-preco input {
    text-align: right !important;
    font-size: 11px;
    padding: 6px 4px !important;
}

/* ===== TOTAIS ===== */
.col-total-linha {
    text-align: center;
    font-weight: 700;
    color: #1e40af;
    background: #f0f9ff;
}

/* ===== FOOTER ===== */
.footer-row {
    position: sticky;
    bottom: 0;
    z-index: 15;
}

.footer-row td {
    background: #f8fafc;
    border-top: 2px solid #cbd5e1;
    padding: 12px 8px;
    font-weight: 700;
    text-align: center;
}

.col-footer-label {
    text-align: left !important;
    padding-left: 10px !important;
    text-transform: uppercase;
    font-size: 11px;
    color: #475569;
    position: sticky;
    left: 0;
    background: #f8fafc;
    z-index: 16;
    width: 350px;
    min-width: 350px;
    max-width: 350px;
}

.col-footer-valor {
    color: #7c3aed;
}

.col-footer-total {
    background: #dcfce7 !important;
    color: #166534;
    font-size: 14px;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    .col-produto-header,
    .col-produto-nome {
        width: 200px;
        min-width: 200px;
        max-width: 200px;
    }

    .col-emb-header,
    .col-und-header,
    .col-emb-valor,
    .col-und-valor {
        width: 30px;
        min-width: 30px;
        max-width: 30px;
    }

    .col-emb-edit {
        width: 65px;
        min-width: 65px;
        max-width: 65px;
    }

    .col-preco-header,
    .col-preco-edit {
        width: 80px;
        min-width: 80px;
        max-width: 80px;
    }
}
