.products-wrapper {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}
.products-filters {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.filter-form {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}
.filter-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.filter-row-top, .filter-row-bottom {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.filter-group {
    flex: 0 1 140px;
}
.filter-group.search {
    flex: 1 1 200px;
    min-width: 180px;
}
.filter-group.date {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 150px;
}
.filter-group.precio { flex: 0 1 105px; }
.filter-group.filas { flex: 0 1 85px; }
.filter-group.precio input,
.filter-group.filas input { text-align: center; }

/* Barra de filtros del listado de productos.
   Arriba van los botones de accion y abajo los filtros, todos en una
   sola linea (nunca se parten: en pantallas chicas scrollea). */
.filter-form-una-fila {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}
.filter-form-una-fila .filter-row-top {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-width: thin;
}
.filter-form-una-fila .filter-row-top .filter-group {
    min-width: 0;
}
.filter-form-una-fila .filter-row-top .filter-group.search {
    flex: 1 1 240px;
    min-width: 200px;
}
.filter-form-una-fila .filter-right {
    justify-content: flex-end;
    padding-top: 0;
    flex-wrap: wrap;
}
.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.filter-group input,
.filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    background: #f3f4f6;
    transition: all 0.15s ease;
}
.filter-group input::placeholder { color: #9ca3af; }
.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border: none;
    background: #e5e7eb;
}
.filter-right {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding-top: 2px;
}
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-icon:hover { border-color: #2563eb; color: #2563eb; }
.btn-icon-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.15s ease;
}
.btn-icon-clear:hover { border-color: #dc2626; color: #dc2626; }
.btn-new {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #111827;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}
.btn-new:hover { background: #374151; }
.btn-export {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #059669;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}
.btn-export:hover { background: #047857; }
.btn-import {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}
.btn-import:hover { background: #6d28d9; }
.table-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.products-table {
    width: 100%;
    border-collapse: collapse;
}
.products-table thead tr { background: #f9fafb; }
.products-table th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
.products-table td {
    padding: 14px 16px;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}
.products-table tbody tr:last-child td { border-bottom: none; }
.products-table tbody tr:hover { background: #fafafa; }
.products-table .row-num { color: #9ca3af; font-size: 12px; width: 40px; }
.products-table .row-code {
    font-family: 'Roboto', monospace;
    font-size: 11px;
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 4px;
}
.products-table .row-name { font-weight: 500; color: #111827; }
.products-table .row-category { color: #6b7280; font-size: 12px; }
.stock-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}
.stock-badge.high { background: #d1fae5; color: #059669; }
.stock-badge.medium { background: #fef3c7; color: #d97706; }
.stock-badge.low { background: #fee2e2; color: #dc2626; }
.products-table .row-price { font-weight: 600; color: #111827; }
.products-table .row-actions { white-space: nowrap; }
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #9ca3af;
    text-decoration: none;
    margin-right: 4px;
    transition: all 0.15s ease;
    vertical-align: middle;
}
.action-btn:last-child { margin-right: 0; }
.action-btn:hover { border-color: #2563eb; color: #2563eb; }
.action-btn.delete {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}
.action-btn.delete:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.action-btn svg { width: 14px; height: 14px; }
.form.FormularioAjax { display: inline !important; }
.pagination-minimal {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #f3f4f6;
}
.pag-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.15s ease;
}
.pag-btn:hover { border-color: #2563eb; color: #2563eb; }
.pag-btn.disabled { opacity: 0.4; cursor: not-allowed; }
.pag-info { font-size: 12px; color: #9ca3af; padding: 0 4px; }

/*============================================================
   CAMBIO MASIVO DE PRECIOS
   ===========================================================*/
.btn-precio {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #0891b2;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-precio:hover { background: #0e7490; }
.btn-historial {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #4b5563;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}
.btn-historial:hover { background: #374151; }
.pm-card {
    width: 96%;
    max-width: 1000px;
    margin: 0;
}
.pm-head {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.pm-head .modal-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}
.pm-head .modal-card-title i { color: #0891b2; }
.pm-body {
    background: #ffffff;
    padding: 20px;
}
.pm-foot {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.pm-foot-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.pm-btn-sec {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.pm-btn-sec:hover { border-color: #0891b2; color: #0891b2; }
.pm-btn-sec:disabled { opacity: 0.5; cursor: not-allowed; }
.pm-btn-cancel {
    padding: 8px 14px;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.pm-btn-cancel:hover { border-color: #dc2626; color: #dc2626; }
.pm-btn-apply {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #0891b2;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.pm-btn-apply:hover { background: #0e7490; }
.pm-hint {
    font-size: 12px;
    color: #6b7280;
    margin: 6px 0 0;
}
/* Modos de alcance */
.pm-modes {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.pm-mode {
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.pm-mode:hover { border-color: #0891b2; color: #0891b2; }
.pm-mode.is-active {
    background: #0891b2;
    border-color: #0891b2;
    color: #fff;
}
/* Filtros del modal */
.pm-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.pm-filters input,
.pm-filters select {
    flex: 1;
    min-width: 160px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #111827;
    background: #ffffff;
}
.pm-filters input:focus,
.pm-filters select:focus {
    outline: none;
    border-color: #0891b2;
}
/* Tabla del modal */
.pm-table-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: auto;
    max-height: 320px;
}
.pm-table {
    width: 100%;
    border-collapse: collapse;
}
.pm-table thead tr {
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 2;
}
.pm-table th {
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6b7280;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.pm-table td {
    padding: 9px 12px;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}
.pm-table tbody tr:last-child td { border-bottom: none; }
.pm-table tbody tr:hover { background: #fafafa; }
.pm-table .row-code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 12px;
    color: #6b7280;
}
.pm-td-check { width: 36px; text-align: center; }
.pm-td-check input { cursor: pointer; }
.pm-precio-actual { font-weight: 600; color: #111827; white-space: nowrap; }
.pm-precio-nuevo { color: #9ca3af; font-weight: 600; white-space: nowrap; }
.pm-precio-nuevo.is-ok { color: #059669; }
.pm-nuevo { color: #059669; font-weight: 600; }
.pm-vacio {
    text-align: center;
    color: #9ca3af;
    padding: 24px 12px !important;
}
/* Paginacion y contador del modal */
.pm-pager {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.pm-sel-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: #0891b2;
}
/* Campos del formulario */
.pm-field { margin-bottom: 12px; }
.pm-field > label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}
.pm-field input[type="text"],
.pm-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #111827;
    background: #ffffff;
}
.pm-field input[type="text"]:focus,
.pm-field select:focus {
    outline: none;
    border-color: #0891b2;
}
.pm-config {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
}
.pm-config-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.pm-config-row .pm-field { flex: 1; min-width: 180px; margin-bottom: 0; }
.pm-radios { display: flex; gap: 14px; align-items: center; }
.pm-radio,
.pm-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}
.pm-check { font-weight: 500; }
/* Vista previa */
.pm-preview {
    margin-top: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.pm-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}
.pm-preview-head h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}
.pm-preview-head h4 i { color: #0891b2; }
.pm-preview-head span { font-size: 12px; color: #6b7280; }
.pm-bloqueados {
    margin: 12px 14px;
    padding: 10px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 12px;
    color: #991b1b;
}
.pm-bloqueados ul { margin: 6px 0 0; padding-left: 18px; }
@media (max-width: 768px) {
    .filter-form { flex-direction: column; }
    .filter-right { justify-content: flex-end; }
    .btn-new { flex: 1; justify-content: center; }
    .btn-precio { flex: 1; justify-content: center; }
    .pm-card { width: 98%; }
    .pm-body { padding: 14px; }
    .pm-foot { justify-content: flex-end; }
}