@media screen and (min-width: 769px) {
    .container {
        width: 100%;
        margin-left: 0 !important;
    }
    .header-text { margin-left: 0; }
}

@media screen and (max-width: 768px) {
    .container {
        width: 100% !important;
        margin-left: 0 !important;
        padding: 10px;
    }
    .header-text { margin-left: 0 !important; }
    .main-logo { width: 60px; height: 60px; }
    .floating-rubro-list { 
        width: min(340px, calc(100vw - 20px)) !important;
        max-width: calc(100vw - 20px) !important;
        left: 10px !important;
    }
    .floating-rubro-list .rubro-list-table {
        width: 100%;
        table-layout: fixed;
    }
    .floating-rubro-list .cell-name {
        min-width: 0;
        width: auto;
    }
    .floating-rubro-list .cell-price {
        display: none;
    }
    .floating-rubro-list .cell-actions {
        width: 82px;
        min-width: 82px;
        gap: 6px;
    }
    .budget-table { 
        font-size: 0.75em;
        table-layout: fixed;
        width: 100%;
        min-width: 0;
    }

    .budget-table th,
    .budget-table td {
        padding: 8px 6px;
    }

    .budget-table th:nth-child(1),
    .budget-table td:nth-child(1) {
        width: auto;
        min-width: 0;
        white-space: normal;
        word-break: break-word;
        font-weight: 600;
    }

    .budget-table th:nth-child(2),
    .budget-table td:nth-child(2) {
        width: 88px;
        min-width: 88px;
        padding: 6px 4px !important;
    }

    .budget-table th:nth-child(3),
    .budget-table td:nth-child(3) {
        width: 112px;
        min-width: 112px;
        font-weight: 700;
        text-align: right;
    }

    .budget-col-rubro {
        min-width: 0;
    }

    .budget-rubro-main {
        display: flex;
        align-items: center;
        min-width: 0;
        gap: 6px;
    }

    .budget-rubro-name {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .budget-col-rubro .btn-details-inline {
        width: 30px;
        height: 30px;
        min-width: 30px;
        margin-left: 0;
        padding: 0;
        font-size: 0.9rem;
        flex: 0 0 auto;
    }

    .budget-mobile-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 2px;
        font-size: 0.68rem;
        font-weight: 700;
        color: #94a3b8;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    body.dark-mode .budget-mobile-meta {
        color: #94a3b8;
    }

    .budget-actions-cell {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        white-space: nowrap;
    }

    .budget-actions-cell > span {
        display: block;
        max-width: 100%;
        font-size: 0.85rem;
        line-height: 1.2;
        white-space: nowrap;
        text-align: right;
    }

    .budget-actions-cell .btn-delete {
        flex: 0 0 auto;
    }

    .total-label-cell {
        text-align: left;
        padding-left: 8px;
    }

    /* Compactamos los controles de cantidad para móvil */
    .budget-qty-cell .quantity-control-modern {
        min-width: unset;
        width: 100%;
        flex-wrap: nowrap;
        gap: 4px;
        justify-content: center;
    }
    .budget-qty-cell .quantity-step-btn {
        display: none !important;
    }
    .budget-qty-cell .quantity-control-pill {
        width: 100%;
        padding: 4px 6px;
    }
    .budget-qty-cell .quantity-input-modern {
        width: 100% !important;
        min-width: 0 !important;
        font-size: 0.75rem;
        padding: 4px 6px;
    }
    .category-row td {
        font-size: 0.72rem;
        padding: 8px 10px !important;
    }
    .catalog-ribbon {
        gap: 8px;
    }
    main.budget {
        overflow-x: hidden;
    }
}
