/* ========================================================================== */
/* CALIDAD - Monitoreo > Outdoor Static > Calidad                           */
/* IMPORTANTE: Este archivo depende de shared-components.css y pendientes.css*/
/* ========================================================================== */

/* Eliminar padding del main-content para esta página */
.main-content:has(.calidad-container) {
    padding: 0 !important;
}

.calidad-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 95px);
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-primary);
}

.calidad-container:focus {
    outline: none;
}

/* ========================================================================== */
/* BOTONES Y SWITCH (Ahora integrados en el grid de filtros)                */
/* ========================================================================== */

/* Iconos SVG en botones */
.btn-icon-svg {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
}

/* Usa clase compartida btn-primary-gradient + btn-large */
.btn-cargar-datos {
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    flex-shrink: 0;
}

/* Usa clase compartida btn-green-gradient + btn-large */
.btn-exportar {
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 130px;
    flex-shrink: 0;
}

/* Botón de Duplicados - Usa clase compartida btn-blue-gradient + btn-large */
.btn-duplicados {
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 130px;
    flex-shrink: 0;
}

/* Usa clase compartida btn-primary-gradient + btn-large */
.btn-items {
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estilos para botones deshabilitados */
.btn-cargar-datos:disabled,
.btn-exportar:disabled,
.btn-items:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ========================================================================== */
/* FILA DE FILTROS                                                          */
/* ========================================================================== */

.filters-row {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background-color: #333333;
    border-bottom: 1px solid #444444;
}

/* Grid de Filtros (2 filas x 2 columnas) */
.filters-grid {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 1rem 1.5rem;
    padding: 1rem 1.5rem;
    background-color: #333333;
    border-bottom: 1px solid #444444;
}

/* Modo claro - Filters grid blanco */
:root.light-mode .filters-grid {
    background-color: #ffffff;
    border-bottom: 1px solid #d1d1d6;
}

.filter-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-cell-left {
    justify-content: flex-start;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 1 auto;
}

.filter-item-small {
    flex: 0 0 auto;
}

.filter-item-small .modern-filter-select,
.filter-item-small .modern-date-display,
.filter-item-small .date-picker-container {
    width: 150px;
}

.filter-item-full {
    flex: 1;
}

.filter-item-full .autocomplete-container {
    width: 100%;
}

/* Row 1: Usuario y Filtro aumentados */
.filter-item:not(.filter-item-small) .modern-filter-select:not(.autocomplete-input) {
    width: 338px;
}

/* Row 2: Año y Ciclo más pequeños */
.filters-row:nth-child(2) .filter-item-small .modern-filter-select {
    width: 100px;
}

.filter-item label {
    font-weight: 600;
    color: white;
    white-space: nowrap;
    font-size: 0.9rem;
}

/* Modo claro - Labels con texto oscuro */
:root.light-mode .filter-item label {
    color: #1c1c1e;
}

/* Selector de Fecha Personalizado */
.date-picker-container {
    position: relative;
    flex: 1;
    cursor: pointer;
}

.modern-date-display {
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border: 2px solid #444444;
    border-radius: 10px;
    background-color: #3a3a3a;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.modern-date-display:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(240, 116, 0, 0.2);
}

/* Modo claro - Date picker con fondo blanco y texto oscuro */
:root.light-mode .modern-date-display {
    background-color: #ffffff;
    color: #1c1c1e;
    border: 2px solid #d1d1d6;
}

:root.light-mode .modern-date-display:hover {
    border-color: var(--primary-color);
    background-color: #f5f5f7;
    box-shadow: 0 0 8px rgba(240, 116, 0, 0.2);
}

.calendar-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    stroke: var(--primary-color);
    pointer-events: none;
}

/* Autocomplete para "Seleccionar Filtro" */
.autocomplete-container {
    position: relative;
    flex: 1;
}

.autocomplete-input {
    width: 100%;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.autocomplete-option {
    padding: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.autocomplete-option:last-child {
    border-bottom: none;
}

.autocomplete-option:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.autocomplete-option.highlighted {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.autocomplete-info-message {
    padding: 0.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    background-color: rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border-color);
}

/* ========================================================================== */
/* CONTENEDOR PRINCIPAL - BOTTOM CONTAINER (estilo Pendientes)              */
/* ========================================================================== */

.bottom-container {
    flex: 1;
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
    background-color: var(--bg-primary);
    overflow: hidden;
}

/* column-left, column-right, column-title heredan de shared-components.css con overrides específicos */
.column-left {
    flex: 2;
}

.column-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow: hidden;
}

/* Override de column-title con grid específico para Calidad */
.column-title {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

/* Títulos de las secciones derechas (Categorías y Fotografía) - centrados */
.column-right .column .column-title {
    display: block;
    text-align: center;
}

.column-title .title-text {
    justify-self: start;
}

.column-title .items-counter {
    justify-self: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Contenedor de acciones del header (Eliminar Items + Eliminar Filtros) */
.column-title .header-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Botón Eliminar Items - mismo diseño que btn-delete-item de BitacoraItems */
.column-title .btn-delete-items-header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #dc3545, #ff6b6b);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.column-title .btn-delete-items-header svg {
    width: 18px;
    height: 18px;
    color: white;
    transition: transform 0.2s ease;
}

.column-title .btn-delete-items-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.45);
    background: linear-gradient(135deg, #c82333, #e74c3c);
}

.column-title .btn-delete-items-header:hover svg {
    transform: scale(1.1);
}

.column-title .btn-delete-items-header:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.column-title .btn-clear-all-filters {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.4rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.column-title .btn-clear-all-filters svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-primary);
    transition: stroke 0.3s ease;
}

/* Sin filtros activos: NO cambia el background al hacer hover */
.column-title .btn-clear-all-filters:not(.active):hover {
    /* No cambiar background ni border */
}

/* Con filtros activos: imagen naranja */
.column-title .btn-clear-all-filters.active {
    background: none;
    border-color: var(--border-color);
}

.column-title .btn-clear-all-filters.active svg {
    stroke: var(--primary-color);
}

/* Con filtros activos: NO cambia al hacer hover */
.column-title .btn-clear-all-filters.active:hover {
    background: none;
    border-color: var(--border-color);
}

.column-title .btn-clear-all-filters.active:hover svg {
    stroke: var(--primary-color);
}

/* Label simple sin borde */
.items-counter-label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

/* ========================================================================== */
/* TABLA CON FILTROS TIPO EXCEL                                             */
/* ========================================================================== */

.table-body {
    flex: 1;
    overflow: auto;
    background-color: var(--bg-primary);
    border-radius: 6px;
    padding: 0 0.5rem 0.5rem 0.5rem;
}

.calidad-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.calidad-table thead {
    position: sticky;
    top: 0;
    z-index: 500;
    background: linear-gradient(135deg, #F07400, #00b4ff);
}

.calidad-table th {
    padding: 0.5rem 0.5rem;
    text-align: left;
    font-weight: 700;
    color: white;
    border-bottom: 2px solid var(--border-color);
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 500;
    line-height: 1.2;
}

.th-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.th-header > span {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.sort-indicator {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.65rem;
    opacity: 0.85;
    line-height: 1;
}

.sort-indicator svg {
    width: 10px;
    height: 10px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sort-order {
    font-size: 0.55rem;
    font-weight: 700;
    opacity: 0.7;
}

.filter-toggle-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.filter-toggle-btn svg {
    width: 14px;
    height: 14px;
    stroke: white;
}

.filter-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.filter-toggle-btn:hover svg {
    stroke: white;
}

.filter-toggle-btn.filtered {
    background: none;
}

.filter-toggle-btn.filtered svg {
    stroke: #80350E;
    stroke-width: 3.5;
}

/* Dropdown de filtro tipo Excel */
.column-filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 250px;
    margin-top: 0.5rem;
}

/* Para las últimas columnas, posicionar a la derecha */
.column-filter-dropdown-right {
    left: auto;
    right: 0;
}

.filter-search {
    width: calc(100% - 2rem);
    padding: 0.5rem;
    margin: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.filter-search:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-options {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.filter-option:hover {
    background-color: rgba(240, 116, 0, 0.1);
}

.filter-option input[type="checkbox"] {
    cursor: pointer;
}

.filter-option span {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.filter-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border-color);
}

.filter-actions button {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.filter-actions button.btn-secondary {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.filter-actions button.btn-secondary:hover {
    background-color: var(--border-color);
}

.filter-actions button.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.filter-actions button.btn-primary:hover {
    box-shadow: 0 2px 8px rgba(240, 116, 0, 0.3);
}

.filter-actions button:not(.btn-secondary):not(.btn-primary) {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.filter-actions button:not(.btn-secondary):not(.btn-primary):hover {
    background-color: var(--border-color);
}

.calidad-table tbody tr {
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
    user-select: none;
    -webkit-user-select: none;
}

.calidad-table tbody tr:hover {
    background-color: rgba(240, 116, 0, 0.05);
}

.calidad-table tbody tr.selected {
    background-color: rgba(240, 116, 0, 0.15);
    border-left: 4px solid var(--primary-color);
}

/* Filas marcadas para eliminar (desde Duplicados) */
.calidad-table tbody tr.marked-delete {
    background-color: rgba(220, 53, 69, 0.15);
    border-left: 4px solid #dc3545;
}

.calidad-table tbody tr.marked-delete:hover {
    background-color: rgba(220, 53, 69, 0.25);
}

.calidad-table tbody tr.marked-delete.selected {
    background-color: rgba(220, 53, 69, 0.3);
    border-left: 4px solid #dc3545;
}

.calidad-table td {
    padding: 0.5rem 0.5rem;
    color: var(--text-primary);
    white-space: nowrap;
    line-height: 1.2;
}

/* El scrollbar usa el estilo global definido en app.css */

/* ========================================================================== */
/* CONTENEDOR DE CATEGORÍAS                                                 */
/* ========================================================================== */

.categorias-body {
    flex: 1;
    overflow-y: auto;
    background-color: var(--bg-primary);
    border-radius: 6px;
    padding: 0.5rem;
}

.categorias-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.categorias-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bg-primary);
}

.categorias-table th {
    padding: 0.5rem 0.5rem;
    text-align: center;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    background-color: var(--bg-primary);
    line-height: 1.2;
}

.categorias-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.categorias-table tbody tr:hover {
    background-color: rgba(240, 116, 0, 0.05);
}

.categorias-table td {
    padding: 0.5rem 0.5rem;
    color: var(--text-primary);
    text-align: left;
    line-height: 1.2;
}

.categorias-body .empty-message {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 1.5rem;
}

/* El scrollbar usa el estilo global definido en app.css */

/* ========================================================================== */
/* CONTENEDOR DE FOTOGRAFÍA                                                 */
/* ========================================================================== */

.foto-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--bg-primary);
    border-radius: 6px;
    padding: 0;
}

.foto-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Usa clases compartidas no-image-placeholder y empty-message */
.no-image-placeholder,
.empty-message {
}

/* ========================================================================== */
/* MODAL DE SELECTOR DE FECHA IOS STYLE - Usa modal-overlay compartido      */
/* ========================================================================== */

/* Override z-index para este modal específico */
.modal-overlay {
    z-index: 2000;
    background-color: rgba(0, 0, 0, 0.7);
}

.date-picker-modal {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.date-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(240, 116, 0, 0.1) 0%, rgba(0, 180, 255, 0.1) 100%);
}

.date-picker-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close-btn:hover {
    background-color: rgba(240, 116, 0, 0.1);
    color: var(--primary-color);
}

.date-picker-body {
    padding: 2rem 1rem;
}

.date-picker-wheels {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.date-wheel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.wheel-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wheel-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wheel-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(240, 116, 0, 0.2);
}

.wheel-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(240, 116, 0, 0.3);
}

.date-picker-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-date-cancel,
.btn-date-confirm {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-date-cancel {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-date-cancel:hover {
    background-color: var(--border-color);
}

.btn-date-confirm {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 3px 10px rgba(240, 116, 0, 0.3);
}

.btn-date-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 116, 0, 0.4);
}

.btn-date-confirm:active {
    transform: translateY(0);
}

/* ========================================================================== */
/* MODO CLARO - LIGHT MODE                                                  */
/* ========================================================================== */


:root.light-mode .filters-row {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

:root.light-mode .filters-grid {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

:root.light-mode .filter-item label {
    color: #333333;
}

:root.light-mode .modern-date-display {
    background-color: #ffffff;
    border-color: #e0e0e0;
    color: #333333;
}

:root.light-mode .calidad-table tbody tr:hover {
    background-color: rgba(240, 116, 0, 0.08);
}

:root.light-mode .calidad-table tbody tr.selected {
    background-color: rgba(240, 116, 0, 0.2);
}

:root.light-mode .calidad-table tbody tr.marked-delete {
    background-color: rgba(220, 53, 69, 0.12);
}

:root.light-mode .calidad-table tbody tr.marked-delete:hover {
    background-color: rgba(220, 53, 69, 0.2);
}

:root.light-mode .calidad-table tbody tr.marked-delete.selected {
    background-color: rgba(220, 53, 69, 0.25);
}

/* ========================================================================== */
/* MULTI-SELECCIÓN DE FILAS                                                 */
/* ========================================================================== */

.calidad-table tbody tr.primary-selected {
    background-color: rgba(240, 116, 0, 0.22);
    border-left: 4px solid var(--primary-color);
}

.calidad-table tbody tr.selected:not(.primary-selected) {
    background-color: rgba(240, 116, 0, 0.10);
    border-left: 3px solid rgba(240, 116, 0, 0.5);
}

.calidad-table tbody tr.selected:hover {
    background-color: rgba(240, 116, 0, 0.18);
}

/* Modo Claro - Multi-selección */
:root.light-mode .calidad-table tbody tr.primary-selected {
    background-color: rgba(240, 116, 0, 0.25);
}

:root.light-mode .calidad-table tbody tr.selected:not(.primary-selected) {
    background-color: rgba(240, 116, 0, 0.12);
}

/* ========================================================================== */
/* RESPONSIVE                                                                */
/* ========================================================================== */

@media (max-width: 1400px) {
    /* Permitir scroll en el contenedor principal */
    .calidad-container {
        height: auto;
        min-height: calc(100vh - 95px);
        overflow-y: auto;
    }

    .bottom-container {
        flex: none;
        flex-direction: column;
        gap: 1rem;
        overflow: visible;
    }

    .column-left,
    .column-right {
        flex: none;
        overflow: visible;
    }

    .column-right .column {
        flex: none;
    }

    /* Aspect ratio para foto en pantallas medianas */
    .foto-body {
        flex: none;
        height: auto;
        aspect-ratio: 16 / 9;
        min-height: 350px;
        padding: 0;
    }

    /* Ajustar imagen/video para mantener proporción */
    .foto-item {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }
}

@media (max-width: 768px) {
    .calidad-container {
        height: auto;
        min-height: calc(100vh - 95px);
        overflow-y: auto;
    }

    .btn-cargar-datos,
    .btn-exportar {
        padding: 0.5rem 1.2rem;
        font-size: 0.85rem;
    }

    .filters-row {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .filter-cell {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-item {
        width: 100%;
        min-width: unset;
    }

    .bottom-container {
        flex: none;
        overflow: visible;
    }

    .column-left,
    .column-right {
        flex: none;
        overflow: visible;
    }

    .column-right .column {
        flex: none;
    }

    .calidad-table {
        font-size: 0.85rem;
    }

    .table-body {
        max-height: 300px;
    }

    /* Aspect ratio para tablets */
    .foto-body {
        flex: none;
        height: auto;
        aspect-ratio: 16 / 9;
        min-height: 300px;
        padding: 0;
    }

    .foto-item {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }
}

@media (max-width: 480px) {
    .calidad-container {
        height: auto;
        min-height: calc(100vh - 95px);
        overflow-y: auto;
    }

    .btn-cargar-datos,
    .btn-exportar {
        width: 100%;
    }


    .bottom-container {
        flex: none;
        overflow: visible;
    }

    .column-left,
    .column-right {
        flex: none;
        overflow: visible;
    }

    .column-right .column {
        flex: none;
    }

    .column-title {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        text-align: center;
    }

    .column-title .title-text,
    .column-title .items-counter,
    .column-title .header-actions {
        justify-self: center;
    }

    .table-body {
        max-height: 250px;
    }

    /* Aspect ratio para móviles */
    .foto-body {
        flex: none;
        height: auto;
        aspect-ratio: 16 / 9;
        min-height: 250px;
        padding: 0;
    }

    .foto-item {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }

    .date-picker-wheels {
        flex-direction: column;
    }

    .date-picker-footer {
        flex-direction: column;
    }
}
