/* Filtros inmediatos para la tabla de novedades. */
#novedades-filtros { margin: 26px 0 36px; color: #262a30; font-size: 16px; }
#novedades-filtros [hidden] { display: none !important; }
#novedades-filtros .nf-intro { margin: 0 0 24px; color: #555e68; line-height: 1.6; }
#novedades-filtros .nf-bar { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.5fr); gap: 24px; padding: 22px 24px; background: #f6f7f8; border: 1px solid #e1e4e7; border-radius: 8px; align-items: start; }
#novedades-filtros .nf-panel { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 16px 24px; }
#novedades-filtros label { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 600; }
#novedades-filtros input,
#novedades-filtros select { box-sizing: border-box; width: 100% !important; min-width: 0; height: 46px !important; margin: 0 !important; padding: 10px 12px !important; border: 1px solid #aab1ba; border-radius: 4px; background: #fff; color: #262a30; font: inherit; font-size: 15px; }
#novedades-filtros input::placeholder { font-size: 14px; color: #68717b; }
#novedades-filtros .nf-library-picker { position: relative; }
#novedades-filtros #nf-biblioteca-buscar { padding-right: 48px !important; }
#novedades-filtros #nf-library-toggle { position: absolute; top: 1px; right: 1px; width: 44px; height: 44px; padding: 0; border: 0; border-left: 1px solid #e1e4e7; border-radius: 0 4px 4px 0; background: #fff; color: #87002d; font-size: 20px; cursor: pointer; }
#novedades-filtros .nf-library-popup { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; max-height: 280px; overflow-y: auto; border: 1px solid #aab1ba; border-radius: 4px; background: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
#novedades-filtros #nf-bibliotecas { margin: 0; padding: 4px 0; list-style: none; }
#novedades-filtros #nf-bibliotecas [role="option"] { margin: 0; padding: 12px; min-height: 44px; box-sizing: border-box; line-height: 1.4; font-size: 15px; cursor: pointer; overflow-wrap: anywhere; }
#novedades-filtros #nf-bibliotecas [role="option"]:hover,
#novedades-filtros #nf-bibliotecas .is-active { background: #fbf4f6; color: #87002d; }
#novedades-filtros #nf-bibliotecas [aria-selected="true"] { font-weight: 600; }
#novedades-filtros #nf-library-empty { margin: 0; padding: 12px; color: #555e68; font-size: 14px; }
#novedades-filtros .nf-more { grid-column: 1 / -1; }
#novedades-filtros summary { width: fit-content; padding: 8px 0; color: #87002d; cursor: pointer; font-size: 14px; font-weight: 600; }
#novedades-filtros .nf-secondary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
#novedades-filtros .nf-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 16px; }
#novedades-filtros .nf-chip { min-height: 36px; padding: 6px 12px; border: 1px solid #d8bcc5; border-radius: 18px; color: #87002d; background: #fbf4f6; font-size: 13px; cursor: pointer; overflow-wrap: anywhere; max-width: 100%; }
#novedades-filtros .nf-chip:hover { background: #f2e3e9; }
#novedades-filtros .nf-clear { border: 0; background: transparent; color: #87002d; min-height: 44px; padding: 8px; font-size: 13px; text-decoration: underline; cursor: pointer; }
#novedades-filtros .nf-counter { margin: 18px 0; font-size: 14px; color: #555e68; }
#novedades-filtros .nf-button { min-height: 44px; padding: 10px 16px; border: 1px solid #87002d; border-radius: 4px; background: #fff; color: #87002d; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
#novedades-filtros .nf-button:hover { background: #fbf4f6; }
#novedades-filtros #nf-mobile-toggle { display: none; }
#novedades-filtros .nf-status { padding: 36px 20px; border: 1px solid #e1e4e7; border-radius: 8px; text-align: center; }
#novedades-filtros .nf-status h3 { font-size: 19px; margin: 0 0 10px; }
#novedades-filtros .nf-status p { color: #555e68; margin: 0 0 18px; line-height: 1.6; }
#novedades-filtros a:focus-visible,
#novedades-filtros button:focus-visible,
#novedades-filtros input:focus-visible,
#novedades-filtros select:focus-visible,
#novedades-filtros summary:focus-visible { outline: 3px solid #87002d; outline-offset: 3px; }
#novedades-filtros div.dt-buttons { float: none !important; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 16px; }
#novedades-filtros button.dt-button { min-height: 38px; margin: 0; border-radius: 4px; font-size: 13px; background: #fff; color: #414951; border-color: #ccd2d9; }
#novedades-filtros button.dt-button:hover { background: #fbf4f6; color: #87002d; }
#novedades-filtros table.dataTable { font-size: 16px; }
#novedades-filtros table.dataTable thead { display: table-header-group !important; }
#novedades-filtros table.dataTable th,
#novedades-filtros table.dataTable td { display: table-cell !important; float: none !important; width: auto !important; }
#novedades-filtros table.dataTable th[style*="display: none"],
#novedades-filtros table.dataTable td[style*="display: none"] { display: none !important; }
#novedades-filtros table.dataTable th { font-size: 15px; }
#novedades-filtros table.dataTable td { vertical-align: top; padding: 12px 10px; line-height: 1.5; overflow-wrap: anywhere; }
#novedades-filtros table.dataTable .nf-title-cell > a { font-size: 17px; font-weight: 600; }
#novedades-filtros table.dataTable .nf-title-cell { min-width: 200px; }
#novedades-filtros table.dataTable .nf-date-cell { min-width: 85px; }
#novedades-filtros .nf-signature { margin-top: 4px; color: #555e68; font-size: 14px; line-height: 1.5; }
#novedades-filtros .nf-signature span { font-weight: 600; }
#novedades-filtros table.dataTable td a { color: #87002d; }
#novedades-filtros .nf-table-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-top: 18px; }
#novedades-filtros .dataTables_paginate { margin-top: 0 !important; padding-top: 0; }
#novedades-filtros .dataTables_length select { width: auto !important; height: 38px !important; padding: 6px !important; }
#novedades-filtros .dataTables_length label { font-weight: 400; }
#novedades-filtros .dataTables_paginate .paginate_button.current { color: #fff !important; background: #87002d; border-color: #87002d; }
@media (max-width: 1000px) {
    #novedades-filtros .nf-bar { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    #novedades-filtros .nf-bar { padding: 18px; gap: 16px; }
    #novedades-filtros #nf-mobile-toggle { display: block; justify-self: start; }
    #novedades-filtros .nf-panel { display: none; grid-template-columns: 1fr; }
    #novedades-filtros .nf-panel.is-open { display: grid; }
    #novedades-filtros .nf-secondary { grid-template-columns: 1fr; }
    #novedades-filtros .nf-table-footer { flex-direction: column; align-items: flex-start; }
    #novedades-filtros .dataTables_paginate { width: 100%; text-align: left; }
}

/* Barra compacta: los filtros secundarios no desplazan la tabla. */
#novedades-filtros .nf-intro { margin-bottom: 16px; }
#novedades-filtros .nf-bar { grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); gap: 16px; padding: 14px 16px; align-items: end; }
#novedades-filtros .nf-panel { grid-template-columns: minmax(0, 1fr) 150px auto; gap: 16px; align-items: end; min-width: 0; }
#novedades-filtros .nf-more { grid-column: auto; position: relative; }
#novedades-filtros .nf-more summary { box-sizing: border-box; min-height: 46px; padding: 12px; border: 1px solid #d8bcc5; border-radius: 4px; background: #fff; white-space: nowrap; }
#novedades-filtros .nf-secondary { position: absolute; top: calc(100% + 8px); right: 0; z-index: 21; box-sizing: border-box; width: 580px; max-width: calc(100vw - 40px); margin-top: 0; padding: 18px; border: 1px solid #d8bcc5; border-radius: 6px; background: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
#novedades-filtros .nf-active:empty { padding-top: 0; }
#novedades-filtros .nf-counter { margin: 12px 0; }
#novedades-filtros div.dt-buttons { padding-bottom: 10px; }
@media (min-width: 681px) and (max-width: 1000px) {
    #novedades-filtros .nf-bar { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 680px) {
    #novedades-filtros .nf-bar { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 14px; }
    #novedades-filtros #nf-mobile-toggle { justify-self: end; }
    #novedades-filtros .nf-panel { grid-column: 1 / -1; grid-template-columns: 1fr; }
    #novedades-filtros table.dataTable { width: 100% !important; }
    #novedades-filtros table.dataTable .nf-title-cell { min-width: 0; }
    #novedades-filtros .nf-secondary { position: static; width: 100%; max-width: none; margin-top: 12px; grid-template-columns: 1fr; box-shadow: none; }
}

/* Móvil: más ancho para el título y sin zoom automático de iOS al enfocar campos. */
#novedades-filtros table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before { top: 16px; margin-top: 0; }
@media (max-width: 680px), (pointer: coarse) {
    #novedades-filtros input,
    #novedades-filtros select,
    #novedades-filtros .dataTables_length select { font-size: 16px; }
}
@media (max-width: 680px) {
    #novedades-filtros table.dataTable .nf-title-cell > a { font-size: 16px; }
    #novedades-filtros table.dataTable th.nf-date-cell,
    #novedades-filtros table.dataTable td.nf-date-cell { min-width: 0; width: 1% !important; }
    #novedades-filtros table.dataTable th.nf-date-cell { padding-right: 22px; font-size: 13px; }
    #novedades-filtros table.dataTable td.nf-date-cell { font-size: 14px; }
    #novedades-filtros table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control { padding-left: 30px; }
    #novedades-filtros table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before { left: 4px; }
}
