/* Angarita Gaitán V2.9 — historial sin registros residuales de limpieza */
#modal-historial:not(.hidden){display:flex}
.hist-panel{width:min(1120px,100%);height:min(92vh,890px);margin:auto;background:#fff;border-radius:20px;box-shadow:0 25px 70px #0006;overflow:hidden;display:flex;flex-direction:column;min-width:0;color:#0f172a}
.hist-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;padding:20px 23px 12px;border-bottom:1px solid #e2e8f0}
.hist-head h3{font-size:clamp(19px,2.2vw,24px);font-weight:900;line-height:1.22}
.hist-head h3 i{color:#b45309;margin-right:7px}
.hist-head p{color:#64748b;margin-top:6px;font-size:12px;line-height:1.5}
.hist-head strong{color:#334155}
.hist-icon-btn{border:0;background:#f1f5f9;border-radius:9px;min-width:42px;min-height:40px;display:grid;place-items:center;cursor:pointer;flex-shrink:0}
.hist-icon-btn:hover{background:#e2e8f0}
.hist-summary{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 23px;font-size:12px;font-weight:750;color:#0f766e;background:#f0fdfa;flex-wrap:wrap}
.hist-filters{padding:12px 23px;display:grid;grid-template-columns:minmax(180px,1.6fr) minmax(135px,1fr) minmax(110px,.85fr) minmax(128px,.9fr) minmax(128px,.9fr) auto auto;gap:8px;align-items:end}
.hist-filters label,.hist-confirm-form label{display:flex;flex-direction:column;gap:4px;font-size:11px;font-weight:750;color:#334155;min-width:0}
.hist-filters input,.hist-filters select,.hist-confirm-form input{height:41px;border:1px solid #cbd5e1;border-radius:10px;padding:8px 10px;background:#fff;min-width:0;width:100%;color:#0f172a;font-size:13px}
.hist-filters input:focus,.hist-filters select:focus,.hist-confirm-form input:focus{outline:2px solid #0d9488;outline-offset:1px}
.hist-btn{border-radius:10px;min-height:41px;padding:10px 12px;font-size:12px;font-weight:800;white-space:normal;text-align:center;line-height:1.3;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.hist-btn-primary{background:#047857;color:white}.hist-btn-light{background:#f1f5f9;color:#334155;border:1px solid #cbd5e1}.hist-btn-danger{background:#b91c1c;color:white}.hist-btn:disabled,.hist-page-buttons button:disabled{opacity:.35;cursor:not-allowed}
.hist-actions{padding:7px 23px;display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.hist-check-all{font-size:12px;font-weight:750;color:#334155;display:flex;gap:7px;align-items:center;margin-right:3px;cursor:pointer}
.hist-record input,.hist-check-all input{accent-color:#047857;min-width:18px;width:18px;height:18px;flex-shrink:0}
.hist-notice{padding:8px 23px;font-size:11px;color:#92400e;background:#fffbeb;border-block:1px solid #fde68a;line-height:1.4}
.hist-results{overflow-y:auto;flex:1;min-height:90px;padding:6px 23px;overscroll-behavior:contain}
.hist-record{display:flex;gap:12px;align-items:center;padding:12px 10px;border-bottom:1px solid #e2e8f0;border-radius:8px;cursor:pointer;min-width:0}
.hist-record:hover{background:#f8fafc}.hist-record-body{display:flex;gap:5px;flex-direction:column;min-width:0;flex:1}
.hist-record-main{display:flex;flex-wrap:wrap;gap:8px;font-size:13px;align-items:center;overflow-wrap:anywhere}
.hist-record-main b{color:#0f766e;text-transform:capitalize}
.hist-record-foot{display:flex;flex-wrap:wrap;gap:10px;font-size:11px;color:#64748b}
.hist-empty{padding:24px;text-align:center;color:#64748b}
.hist-bottom{padding:10px 23px;border-top:1px solid #e2e8f0;display:flex;justify-content:space-between;gap:12px;align-items:center;font-size:12px;color:#475569}
.hist-page-buttons{display:flex;gap:7px}.hist-page-buttons button{border:1px solid #cbd5e1;border-radius:9px;padding:9px 14px;background:#f8fafc;font-weight:800}
#modal-historial-borrado:not(.hidden){display:flex}
.hist-confirm-panel{width:min(510px,100%);max-height:92vh;overflow:auto;margin:auto;background:#fff;padding:22px;border-radius:18px;box-shadow:0 20px 50px #0007;display:flex;flex-direction:column;gap:14px}
.hist-confirm-top{display:flex;justify-content:space-between;align-items:center;gap:10px}.hist-confirm-top h3{color:#991b1b;font-size:20px;font-weight:900}
.hist-confirm-info{font-weight:800;color:#1e293b;line-height:1.45}
.hist-confirm-warning{background:#fef2f2;border:1px solid #fecaca;border-radius:10px;padding:13px;color:#991b1b;font-size:12px;line-height:1.5}
.hist-confirm-form{display:flex;flex-direction:column;gap:13px}.hist-confirm-form label{font-size:13px}.hist-confirm-form input{height:46px}
.hist-confirm-buttons{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px}
@media(max-width:920px){.hist-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.hist-filters label:first-child{grid-column:span 2}}
@media(max-width:520px){.hist-panel{height:96dvh;border-radius:11px}.hist-head{padding:13px}.hist-summary,.hist-filters,.hist-actions,.hist-notice,.hist-bottom{padding-left:13px;padding-right:13px}.hist-filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.hist-filters label:first-child{grid-column:span 2}.hist-actions .hist-btn{flex:1 1 140px}.hist-results{padding:3px 10px}.hist-record{padding:12px 5px}.hist-confirm-panel{padding:16px}.hist-confirm-buttons .hist-btn{flex:1 1 100%}}
#modal-historial-borrado{z-index:120}

/* V2.8: módulo visible sin recorte de etiquetas. */
.hist-module{display:inline-flex;align-items:center;max-width:100%;border-radius:7px;padding:3px 8px;background:#f1f5f9;color:#334155;font-size:11px;font-weight:800;overflow-wrap:anywhere}
@media(max-width:1100px){.hist-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.hist-filters label:first-child{grid-column:span 3}}
@media(max-width:690px){.hist-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.hist-filters label:first-child{grid-column:span 2}}
@media(max-width:380px){.hist-filters{grid-template-columns:minmax(0,1fr)}.hist-filters label:first-child{grid-column:span 1}}

/* V2.9: distinguir claramente la limpieza global de la selección, sin texto superpuesto. */
.hist-btn-clear-all {background:#7f1d1d;border:1px solid #450a0a;max-width:100%;overflow-wrap:anywhere}
.hist-btn-clear-all:hover {background:#991b1b}
.hist-actions {row-gap:10px}
.hist-actions > * {max-width:100%;min-width:0}
@media(max-width:700px){.hist-btn-clear-all{width:100%;flex:1 1 100%}}
