/* A single table remains the source for desktop, mobile and DataTables exports. */
@media (max-width: 767px) {
    .admin-rework main > .container, .users-admin { max-width: 100%; min-width: 0; }
    .admin-rework .dataTables_wrapper, .users-admin .dataTables_wrapper {
        display: block !important; overflow: visible; min-width: 0; max-width: 100%;
    }
    .sales-table-wrap, .users-table-wrap { overflow: visible !important; }
    .admin-mobile-tables table.paom-card-table, .admin-rework table.paom-card-table, .users-admin table.paom-card-table {
        display: block !important; width: 100% !important; min-width: 0 !important;
        border: 0 !important; table-layout: auto !important;
    }
    .paom-card-table thead {
        position: absolute; width: 1px; height: 1px; overflow: hidden;
        clip: rect(0, 0, 0, 0); clip-path: inset(50%);
    }
    .paom-card-table tbody { display: grid !important; gap: 14px; width: 100%; }
    .paom-card-table tbody tr {
        box-sizing: border-box;
        display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%; padding: 8px 14px; border: 1px solid #eadde0 !important;
        border-radius: 16px; background: #fff !important;
        box-shadow: 0 5px 18px rgba(43, 13, 20, .05);
    }
    .paom-card-table tbody tr[hidden] { display: none !important; }
    .paom-card-table tbody td {
        box-sizing: border-box;
        display: flex !important; flex-direction: column; align-items: flex-start;
        justify-content: flex-start; gap: 6px; width: auto !important;
        min-width: 0 !important; max-width: 100%; height: auto !important;
        padding: 12px 6px !important; border: 0 !important; text-align: left !important;
        white-space: normal !important; overflow-wrap: anywhere; font-size: .85rem !important;
    }
    .paom-card-table tbody td::before {
        content: attr(data-label); color: #876f76; font-size: .66rem;
        font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    }
    .paom-card-table tbody td:first-child {
        grid-column: 1 / -1; border-bottom: 1px solid #f0e6e8 !important;
        color: #2b0d14; font-weight: 700;
    }
    .paom-card-table tbody td:last-child, .paom-card-table .paom-card-actions {
        grid-column: 1 / -1; width: auto !important; text-align: left !important;
        border-top: 1px solid #f0e6e8 !important;
    }
    .paom-card-table tbody td.paom-card-empty { grid-column: 1 / -1; padding: 24px 6px !important; }
    .paom-card-table td.paom-card-empty::before { content: none; }
    .paom-card-table td > *, .paom-card-table .users-contact, .paom-card-table .users-sales,
    .paom-card-table .users-dates, .paom-card-table .users-actions {
        min-width: 0 !important; max-width: 100%; white-space: normal;
    }
    .paom-card-table .sales-client { max-width: 100%; overflow: visible; white-space: normal; }
    .paom-card-table .sales-view { width: 44px; height: 44px; }
    .paom-card-table .users-actions, .paom-card-table .product-actions { justify-content: flex-start; flex-wrap: wrap; }
    .paom-card-table a.btn-floating { width: 44px !important; height: 44px !important; }
    .admin-rework .dataTables_filter, .users-admin .dataTables_filter,
    .admin-rework .dataTables_length, .users-admin .dataTables_length,
    .admin-rework .dt-buttons, .users-admin .dt-buttons {
        float: none !important; width: 100% !important; max-width: 100%;
        margin: 0 0 12px !important; text-align: left !important;
    }
    .admin-rework .dt-buttons, .users-admin .dt-buttons { display: flex !important; flex-wrap: wrap; gap: 6px; }
    .admin-rework .dataTables_filter label, .users-admin .dataTables_filter label { display: block !important; width: 100%; }
    .admin-rework .dataTables_filter input, .users-admin .dataTables_filter input {
        box-sizing: border-box; width: 100% !important; max-width: 100%; margin-left: 0 !important;
    }
    .admin-rework .dataTables_paginate, .users-admin .dataTables_paginate { float: none !important; text-align: center !important; }
    .admin-rework .paginate_button, .users-admin .paginate_button { padding: 8px !important; min-height: 40px; }
    .sales-directory { padding: 14px; }
    .sales-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sales-summary article { padding: 12px; gap: 8px; min-width: 0; }
    .sales-summary article > i { width: 34px; height: 34px; flex-shrink: 0; font-size: 19px; }
}

/* Sale detail: keep secondary data in the flow instead of floating over rows. */
@media (max-width: 767px) {
    .sale-detail { max-width: 100%; padding: 12px; color: #2b0d14; }
    .sale-detail > .row { margin-bottom: 16px; }
    .sale-detail h5 { font-size: 1.5rem; font-weight: 700; text-align: left; line-height: 1.3; }
    .sale-detail .collection { border: 1px solid #eadde0; border-radius: 16px; margin: 0 0 20px; overflow: hidden; }
    .sale-detail .collection-header { background: #fff5f6 !important; color: #2b0d14; padding: 16px !important; }
    .sale-detail .collection-header h6 { font-size: 1rem; font-weight: 700; margin: 0; color: #2b0d14 !important; }
    .sale-detail .collection-item { padding: 16px !important; font-size: .9rem; line-height: 1.6; overflow-wrap: anywhere; }
    .sale-detail .collection-item > .secondary-content {
        float: none; display: block; position: static; color: #2b0d14; margin-top: 12px;
        padding-top: 12px; border-top: 1px solid #f0e6e8;
    }
    .sale-detail .collection-item strong { font-weight: 600; }
    .sale-detail .material-icons.left { font-size: 20px; margin-right: 10px; line-height: 1.4; }
    .sale-detail .sale-detail-state { background: #fff !important; }
    .sale-detail .sale-state { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #fff3d6; color: #785b19; font-size: .75rem; font-weight: 700; }
    .sale-detail .sale-state--finalizada { background: #e5f6ee; color: #17694f; }
    .sale-detail .sale-state--cancelada, .sale-detail .sale-state--rechazada { background: #fbeaec; color: #a33550; }
    .sale-detail .grey.lighten-3 { background: #eaf6f0 !important; color: #17694f; }
    .sale-detail .collection-item p { margin: 0; }
    .sale-detail .btn-small { height: auto; min-height: 44px; line-height: 1.4; padding: 12px 16px; white-space: normal !important; margin: 4px; max-width: 100%; overflow: visible; }
    .sale-detail table { margin: 12px auto; width: calc(100% - 24px) !important; }
}

@media (max-width: 767px) {
    .publications-admin > br { display: none; }
    .publications-admin .dataTables_wrapper > .row { margin: 0; display: flex; flex-direction: column; gap: 12px; }
    .publications-admin .dataTables_wrapper > .row > .col { float: none; width: 100% !important; padding: 0; }
    .publications-admin .dataTables_wrapper { padding: 14px !important; }
    .publications-admin .dataTables_filter, .publications-admin .dataTables_length { padding: 0 !important; }
    .publications-admin .dataTables_filter input { margin: 8px 0 0 !important; }
    .publications-admin table tbody td { padding: 9px 4px !important; }
    .publications-admin table tbody td:nth-child(3) { grid-column: 1 / -1; font-size: 1rem !important; font-weight: 600; }
    .publications-admin .publication-actions { display: flex; gap: 8px; margin: 0; }
    .publications-admin table a.btn-floating { display: flex !important; align-items: center; justify-content: center; }
    .publications-admin table a.btn-floating i { width: auto !important; line-height: 1 !important; }
}

@media (max-width: 767px) {
    .publications-admin .dataTables_wrapper > .col { float: none !important; width: 100% !important; padding: 0 0 12px !important; }
    .publications-admin .dataTables_wrapper > .col > br { display: none; }
    .publications-admin .cajaBotones { display: flex; gap: 8px; flex-wrap: wrap; }
    .publications-admin .dataTables_wrapper > .col label { display: block; width: 100%; }
    .publications-admin .dataTables_wrapper > .col input { box-sizing: border-box; width: 100% !important; height: 44px; margin: 8px 0 0 !important; padding: 0 12px; border: 1px solid #dfd0d4 !important; border-radius: 10px; }
}
