.selfcost-desktop-shell {
    display: block;
}

.selfcost-table-shell {
    display: none;
}

.selfcost-flex-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    box-sizing: border-box;
}

.selfcost-flex-row {
    display: flex;
    align-items: center;
    padding: 0.68rem 0.85rem;
    background: #ffffff;
    border: 1px solid #e4e7ea;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.selfcost-header {
    background: #f3f5f7;
    border: 1px solid #dce2e7;
    font-weight: 700;
}

.total-row {
    background: #f6faff;
    border: 1px solid #cfe0f5;
}

.total-row .gross,
.total-row .net {
    font-weight: 900;
    color: #005e9e;
}

.selfcost-flex-row .flex-col {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    line-height: 1.3;
}

.flex-col.name {
    flex: 1.8 1 0;
    font-weight: 600;
    color: #222;
}

.flex-col.qty {
    flex: 0.95 1 0;
    color: #444;
}

.flex-col.net {
    flex: 0.8 1 0;
    text-align: right;
    color: #0f766e;
    font-weight: 600;
}

.flex-col.gross {
    flex: 0.8 1 0;
    text-align: right;
    color: #002f5d;
    font-weight: 700;
}

.flex-col.action {
    flex: 0 0 8.75rem;
    text-align: right;
}

.selfcost-edit-button {
    width: 100%;
    justify-content: center;
}

.flex-col.action .selfcost-edit-button {
    width: 100%;
    min-width: 0;
}

.selfcost-table-shell {
    width: 100%;
    overflow-x: auto;
    padding: 0.15rem 0 0;
}

.selfcost-table {
    min-width: 42rem;
}

.selfcost-table .jans-table-header {
    top: 0;
}

.selfcost-table .jans-table-header .jans-table-cell {
    background: #eef4ff;
    border-color: #dbe7fb;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.selfcost-table .jans-table-row .jans-table-cell {
    min-height: 3.2rem;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-color: #e2e8f0;
    white-space: normal;
    line-height: 1.35;
}

.selfcost-table .jans-table-row:hover .jans-table-cell {
    border-color: #bfdbfe;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.selfcost-col-product {
    flex: 1.8 1 16rem;
}

.selfcost-col-quantity {
    flex: 0.9 1 8rem;
    color: #475569;
    font-variant-numeric: tabular-nums;
}

.selfcost-col-net,
.selfcost-col-gross {
    flex: 0.75 1 7rem;
    justify-content: flex-end;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.selfcost-col-net {
    color: #0f766e;
}

.selfcost-col-gross {
    color: #1d4ed8;
}

.selfcost-col-action {
    flex: 0 0 10rem;
    justify-content: center;
}

.selfcost-product-cell {
    font-weight: 700;
    color: #0f172a;
}

.selfcost-product-cell--total {
    color: #0f3d91;
}

.selfcost-row--total .jans-table-cell {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
    font-weight: 800;
}

.self-cost-table__empty {
    padding: 0.85rem 1rem;
    border: 1px dashed #cbd5e1;
    border-radius: 0.9rem;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .selfcost-desktop-shell {
        display: none;
    }

    .selfcost-table-shell {
        display: block;
        margin: 0 -0.15rem;
        padding-bottom: 0.2rem;
    }

    .selfcost-table {
        min-width: 34rem;
    }

    .selfcost-table .jans-table-cell {
        padding: 0.55rem 0.6rem;
        font-size: 0.8rem;
    }

    .selfcost-col-product {
        flex-basis: 12rem;
    }

    .selfcost-col-quantity {
        flex-basis: 6.5rem;
    }

    .selfcost-col-net,
    .selfcost-col-gross {
        flex-basis: 6rem;
    }

    .selfcost-col-action {
        flex-basis: 2.9rem;
    }

    .selfcost-edit-button {
        width: 2.35rem;
        min-width: 2.35rem;
        padding-inline: 0;
    }

    .selfcost-edit-button .rz-button-text {
        display: none;
    }

    .selfcost-edit-button .rz-button-icon-left {
        margin-right: 0;
    }
}

@media (max-width: 1100px) {
    .selfcost-flex-row {
        padding: 0.58rem 0.72rem;
        gap: 0.55rem;
    }

    .selfcost-flex-row .flex-col {
        font-size: 0.82rem;
    }

    .flex-col.action {
        flex-basis: 2.85rem;
    }

    .flex-col.action .selfcost-edit-button {
        width: 2.3rem;
        min-width: 2.3rem;
        padding-inline: 0;
    }

    .flex-col.action .selfcost-edit-button .rz-button-text {
        display: none;
    }

    .flex-col.action .selfcost-edit-button .rz-button-icon-left {
        margin-right: 0;
    }
}
