:root{
  --bg:#cfe5f2;--panel:#cfe5f2;--panel2:#d8eef9;--ink:#143c6d;--muted:#536b82;
  --sky:#4ea8dc;--navy:#153f73;--red:#cf2b13;--green:#10b981;--gold:#eab308;--line:#111827;
  --softLine:rgba(17,24,39,.22);--white:#fff;--shadow:0 10px 24px rgba(13,42,72,.20)
}
*{box-sizing:border-box}body{margin:0;background:#edf2f5;color:var(--ink);font-family:'Segoe UI',Arial,sans-serif}.appShell{display:grid;grid-template-columns:315px 1fr;min-height:100vh}.sidebar{background:var(--bg);border-right:2px solid var(--line);height:100vh;position:sticky;top:0;overflow:auto;padding:8px}.brand{display:grid;grid-template-columns:118px 1fr;align-items:center;gap:8px;border-bottom:1px solid var(--softLine);padding:0 0 6px}.brand img{width:105px;height:auto;margin:auto}.brand h1{margin:0;font-size:30px;letter-spacing:1px;color:#555}.brand span{display:block;font-size:18px;color:#555}.brand .admin{font-family:Georgia,serif;color:#9b2644;font-weight:800;font-size:24px;margin-top:4px}.menu{display:grid;gap:7px;margin:10px 0}.menu a{text-decoration:none;background:#eaf6fe;border:1px solid #94c4e6;border-left:5px solid #54a8df;color:#143c6d;padding:9px 9px;border-radius:9px;font-weight:800;font-size:13px;box-shadow:0 2px 7px rgba(0,0,0,.07)}.menu a:hover,.menu a.active{background:#fff;color:#0a68a8;border-left-color:#cf2b13}.sideNote,.filterPanel{background:#b7d8ed;border:1px solid #8dbde0;box-shadow:var(--shadow);padding:9px;border-radius:6px;margin:9px 0}.sideNote b,.filterPanel b{display:block;color:#102f55}.sideNote span{font-size:12px;color:#314f69}.filterPanel label{display:block;font-weight:800;font-size:13px;margin:8px 0 3px;color:#1b3147}.filterPanel select{width:100%;height:34px;background:#cbe7fa;border:1px solid #eef9ff;color:#445;padding:4px 7px;font-size:14px}.filterActions{display:flex;gap:6px;margin-top:8px}.workspace{padding:0;background:var(--bg);overflow:auto}.hero{background:var(--bg);border-bottom:2px solid var(--line);padding:8px 12px;display:flex;justify-content:space-between;align-items:center;gap:10px}.hero h2{margin:0;color:var(--navy);text-align:center;text-transform:uppercase;font-size:23px;font-weight:900;letter-spacing:.4px}.hero p,.eyebrow{display:none}.toolbar{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.fileBtn,.btn{border:1px solid #699abb;background:#e7f5ff;color:#143c6d;border-radius:5px;padding:7px 9px;font-weight:800;cursor:pointer;font-size:12px}.fileBtn input{display:none}.btn.primary,.fileBtn{background:#46a6dc;color:#fff;border-color:#2b82b3}.statebar{display:flex;gap:8px;flex-wrap:wrap;padding:6px 12px;background:#e6f4fc;border-bottom:1px solid var(--softLine)}.statebar span{font-size:12px;color:#173f73;font-weight:800}.kpiStrip{display:grid;grid-template-columns:repeat(5,1fr);gap:0;padding:0 12px 8px}.kpiCard{background:var(--bg);border:1.5px solid var(--line);min-height:76px;padding:4px 7px;text-align:center}.kpiCard span{display:block;color:#153f73;font-size:15px;font-weight:800;line-height:1.05}.kpiCard strong{display:block;color:var(--sky);font-size:30px;font-weight:800;letter-spacing:2px;margin:8px 0 2px}.kpiCard small,.kpiCard em{display:none}.departmentFilter{display:none}.movableGrid{display:grid;grid-template-columns:360px 1fr 1fr;gap:0;padding:0 12px 10px}.chartBox{background:var(--bg);border:1.7px solid var(--line);border-radius:0;box-shadow:none;overflow:hidden;min-height:315px}.chartBox.wide{grid-column:span 2}.chartBox.leftTall{grid-row:span 2}.chartBox.dragging{opacity:.75;outline:4px dashed #54a8df}.chartHead{height:44px;display:flex;justify-content:space-between;align-items:flex-start;background:var(--bg);border-bottom:1.5px solid var(--line);padding:4px 6px}.dragHandle{cursor:grab}.chartTitle h3{margin:0;color:#143c6d;text-transform:uppercase;text-align:center;font-size:16px;font-weight:900}.chartTitle p{display:none}.chartActions{display:flex;gap:3px;align-items:center}.btnChart{width:23px;height:23px;border:1px solid #b7c9d6;background:#f8fbfd;color:#143c6d;border-radius:2px;display:grid;place-items:center;font-size:12px;cursor:pointer}.btnChart:hover{background:#dff2ff;transform:translateY(-1px)}.chartCanvas{height:265px;padding:4px 8px}.chartCanvas canvas{width:100%!important;height:100%!important}.chartFoot{display:none}.gaugeBox{height:270px;display:grid;place-items:center;position:relative}.gaugeArc{position:absolute;width:330px;height:165px;border-radius:330px 330px 0 0;background:conic-gradient(from 270deg,var(--sky) 0deg,var(--sky) 174deg,#f5f5f5 174deg,#f5f5f5 180deg);top:22px}.gaugeArc:after{content:"";position:absolute;width:205px;height:103px;border-radius:205px 205px 0 0;background:var(--bg);left:63px;bottom:0}.gaugeValue{position:relative;font-size:54px;font-weight:800;color:#153f73;margin-top:84px}.gaugeLabel{position:relative;text-align:center;color:#536b82;font-weight:900}.formulaBox{padding:12px;line-height:1.4;color:#143c6d;font-size:13px}.tableBox{margin:0 12px 14px;background:var(--bg);border:1.7px solid var(--line);box-shadow:none;overflow:hidden}.tableHead{display:flex;justify-content:space-between;align-items:center;padding:8px;border-bottom:1.5px solid var(--line)}.tableHead h3{margin:0;color:#143c6d}.tableHead p{display:none}.tableHead input{border:1px solid #86b9dc;background:#e7f5ff;padding:7px 10px}.tableWrap{max-height:260px;overflow:auto}table{width:100%;border-collapse:collapse;font-size:12px}th,td{border-bottom:1px solid #a7cce2;padding:6px;text-align:left}th{position:sticky;top:0;background:#b7d8ed;color:#143c6d}.modalBackdrop{position:fixed;inset:0;background:rgba(0,0,0,.38);display:none;align-items:center;justify-content:center;z-index:50}.modalBackdrop.show{display:flex}.modalCard{background:#fff;border-radius:14px;box-shadow:0 30px 80px rgba(0,0,0,.25);width:min(780px,92vw);max-height:82vh;overflow:auto;padding:16px}.modalCard h3{margin:0 0 10px;color:#143c6d}.modalCard pre{white-space:pre-wrap;background:#f6fbff;border:1px solid #dbeafe;padding:12px;border-radius:10px}.modalActions{text-align:right}.moduleHint{font-size:12px;font-weight:700;color:#516b80;padding:6px 12px}@media(max-width:1250px){.appShell{grid-template-columns:260px 1fr}.movableGrid{grid-template-columns:1fr}.chartBox.wide,.chartBox.leftTall{grid-column:auto;grid-row:auto}.kpiStrip{grid-template-columns:repeat(2,1fr)}}@media(max-width:850px){.appShell{grid-template-columns:1fr}.sidebar{position:relative;height:auto}.hero{align-items:flex-start;flex-direction:column}.kpiStrip{grid-template-columns:1fr}.brand{grid-template-columns:90px 1fr}.brand img{width:82px}}


/* ================= MEJORA FOMAG: filtros desplegables y reportes por gráfico ================= */
.filterPanel{background:linear-gradient(180deg,#b9ddf3,#a9d1eb);border:1px solid #69aada;border-radius:8px;box-shadow:0 14px 26px rgba(19,63,115,.25);}
.filterPanel b{font-size:16px;margin-bottom:8px}.filterPanel label{font-size:13px;text-transform:none;letter-spacing:.1px}.smartSelect{position:relative;margin:7px 0 10px}.smartSelectBtn{width:100%;height:36px;display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid #eaf8ff;background:#dff3ff;color:#143c6d;border-radius:6px;padding:6px 9px;font-size:13px;font-weight:800;cursor:pointer;box-shadow:inset 0 1px 0 rgba(255,255,255,.7)}.smartSelectBtn:after{content:'⌄';font-size:18px;line-height:1;color:#41657e}.smartSelect.open .smartSelectBtn{background:#fff;border-color:#4ea8dc}.smartPanel{display:none;position:absolute;left:0;right:0;top:40px;background:#f7fcff;border:1px solid #75afd4;border-radius:8px;box-shadow:0 16px 32px rgba(13,42,72,.30);z-index:25;max-height:230px;overflow:auto;padding:6px}.smartSelect.open .smartPanel{display:block}.smartPanel::-webkit-scrollbar{width:9px}.smartPanel::-webkit-scrollbar-track{background:#d3eaf8;border-radius:10px}.smartPanel::-webkit-scrollbar-thumb{background:#4ea8dc;border-radius:10px}.filterSearch{width:100%;border:1px solid #b7d8ed;background:#fff;border-radius:6px;padding:7px 8px;margin-bottom:6px;color:#143c6d}.filterOption{display:flex;align-items:center;gap:6px;padding:6px 5px;border-radius:6px;color:#143c6d;font-size:12px;font-weight:700;cursor:pointer}.filterOption:hover{background:#e3f4ff}.filterOption input{accent-color:#1687c9}.filterCount{font-size:11px;color:#36556e;font-weight:800}.filterActions .btn{flex:1;height:32px;border-radius:7px}.filterActions .btn.primary{background:linear-gradient(180deg,#58b4e8,#2497d2)}
.chartActions{gap:4px;flex-wrap:wrap;justify-content:flex-end}.btnChart{width:auto;min-width:26px;height:24px;padding:0 6px;border-radius:6px;font-size:11px;font-weight:900;background:#f7fcff;border:1px solid #9dc4df;box-shadow:0 2px 5px rgba(13,42,72,.10)}.btnChart .txt{display:none;margin-left:3px}@media(min-width:1400px){.btnChart .txt{display:inline}}.btnChart[data-action="status"]{color:#0f7a3b}.btnChart[data-action="detailExport"]{color:#7c3aed}.chartBox:hover{outline:2px solid rgba(78,168,220,.35);outline-offset:-2px}.moduleExportBar{display:flex;gap:7px;align-items:center;justify-content:flex-end;padding:6px 12px;background:#dff1fb;border-bottom:1px solid var(--softLine)}.moduleExportBar .btn{height:30px}.hiddenDataBox{display:none!important}.modalCard .modalExport{margin-left:6px}.statusPill{display:inline-block;padding:4px 8px;border-radius:999px;font-weight:900;margin:3px;background:#e5e7eb;color:#143c6d}.statusPill.cumple{background:#dcfce7;color:#166534}.statusPill.aceptable{background:#fef3c7;color:#92400e}.statusPill.nocumple{background:#fee2e2;color:#991b1b}.reportBlock{font-family:Consolas,monospace;white-space:pre-wrap;background:#f6fbff;border:1px solid #dbeafe;padding:12px;border-radius:10px;color:#1f3347}.tableBox{display:none!important}


/* ================= MEJORA FINAL: BOTONCITOS DE ESTADO + MEDIDORES EN REPORTES ================= */
.statusQuickBar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:6px 12px 9px;background:#d9edf8;border-bottom:1px solid rgba(17,24,39,.2)}
.statusBtn{border:1px solid #7fb7d9;border-radius:999px;background:#f7fcff;color:#143c6d;font-weight:900;padding:7px 10px;cursor:pointer;box-shadow:0 4px 10px rgba(13,42,72,.10);font-size:12px}.statusBtn:hover{transform:translateY(-1px);background:#fff}.statusBtn b{background:#fff;border-radius:999px;padding:2px 6px;margin-left:4px}.statusBtn.cumple{border-color:#22c55e}.statusBtn.aceptable{border-color:#eab308}.statusBtn.nocumple{border-color:#ef4444}.statusBtn.all{margin-left:auto;border-radius:7px;background:#46a6dc;color:#fff;border-color:#2b82b3}.btnChart[data-action="status"]{background:#ecfdf5;border-color:#52c17e;color:#115e32}.btnChart[data-action="report"]{background:#eff6ff}.btnChart[data-action="excel"]{background:#f0fdf4}.btnChart[data-action="detail"]{background:#faf5ff}.statusCards{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:12px}.statusCard{border-radius:12px;padding:12px;border:1px solid #dbeafe;background:#f8fbff}.statusCard b{display:block;font-size:14px}.statusCard strong{display:block;font-size:30px;margin:4px 0;color:#143c6d}.statusCard span{font-size:12px;color:#536b82;font-weight:800}.statusCard.cumple{border-color:#86efac;background:#f0fdf4}.statusCard.aceptable{border-color:#fde68a;background:#fffbeb}.statusCard.nocumple{border-color:#fecaca;background:#fef2f2}.reportSummary{display:grid;grid-template-columns:210px 1fr;gap:14px;align-items:center;background:#f6fbff;border:1px solid #dbeafe;border-radius:12px;padding:12px;margin-bottom:12px}.miniGauge{height:150px;position:relative;display:grid;place-items:center;text-align:center}.miniGaugeArc{position:absolute;top:8px;width:180px;height:90px;border-radius:180px 180px 0 0;background:conic-gradient(from 270deg,#4da9df 0deg,#4da9df var(--p),#e5e7eb var(--p),#e5e7eb 180deg)}.miniGaugeArc:after{content:"";position:absolute;left:35px;bottom:0;width:110px;height:55px;border-radius:110px 110px 0 0;background:#f6fbff}.miniGaugeArc.cumple{background:conic-gradient(from 270deg,#22c55e 0deg,#22c55e var(--p),#e5e7eb var(--p),#e5e7eb 180deg)}.miniGaugeArc.aceptable{background:conic-gradient(from 270deg,#eab308 0deg,#eab308 var(--p),#e5e7eb var(--p),#e5e7eb 180deg)}.miniGaugeArc.nocumple{background:conic-gradient(from 270deg,#ef4444 0deg,#ef4444 var(--p),#e5e7eb var(--p),#e5e7eb 180deg)}.miniGauge strong{position:relative;margin-top:48px;font-size:28px;color:#143c6d}.miniGauge span{position:relative;font-size:12px;font-weight:900;color:#536b82}.modalTableWrap{max-height:330px;overflow:auto;border:1px solid #dbeafe;border-radius:10px}.modalTable{width:100%;border-collapse:collapse;font-size:12px}.modalTable th{background:#d9edf8;color:#143c6d;position:sticky;top:0}.modalTable td,.modalTable th{border-bottom:1px solid #dbeafe;padding:7px;text-align:left}.modalExportRow{display:flex;justify-content:flex-end;margin-top:10px}.statusDetailsGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.statusDetail{border-radius:12px;border:1px solid #dbeafe;padding:10px;background:#f8fbff;min-height:180px}.statusDetail h4{margin:0 0 8px;color:#143c6d}.statusDetail.cumple{background:#f0fdf4;border-color:#86efac}.statusDetail.aceptable{background:#fffbeb;border-color:#fde68a}.statusDetail.nocumple{background:#fef2f2;border-color:#fecaca}.statusLine{display:flex;justify-content:space-between;gap:8px;border-bottom:1px dashed rgba(20,60,109,.18);padding:6px 0;font-size:12px}.statusLine span{overflow:hidden;text-overflow:ellipsis}.statusLine b{white-space:nowrap;color:#143c6d}@media(max-width:900px){.statusCards,.statusDetailsGrid,.reportSummary{grid-template-columns:1fr}.statusBtn.all{margin-left:0}}

/* Checklist interactivo de estados */
.statusQuickBar{position:relative}
.checkHint{background:#eef8ff;border:1px solid #a8d3ef;color:#143c6d;border-radius:10px;padding:10px 12px;margin-bottom:10px;font-size:13px;font-weight:700}
.checklistGrid .statusDetail{max-height:360px;overflow:auto}
.checkRow{display:grid;grid-template-columns:24px 1fr auto;gap:8px;align-items:center;border-bottom:1px dashed rgba(20,60,109,.18);padding:8px 0;font-size:12px;cursor:pointer}
.checkRow:hover{background:rgba(84,168,223,.08)}
.checkRow input{width:16px;height:16px;accent-color:#46a6dc}
.checkRow span{overflow:hidden;text-overflow:ellipsis;color:#143c6d;font-weight:700}
.checkRow b{white-space:nowrap;color:#143c6d;background:#fff;border-radius:999px;padding:3px 7px;border:1px solid rgba(20,60,109,.12)}
.drillBadge{display:inline-flex;align-items:center;gap:5px;background:#0ea5e9;color:#fff;border-radius:999px;padding:5px 10px;font-size:12px;font-weight:900}
.modalExportRow .btn{margin-left:6px}
/* Reporte ejecutivo OVD */
.btn[data-action="executiveReport"]{background:#0f766e;color:#fff;border-color:#0f766e}
.btnChart[data-action="executiveReport"]{background:#ecfdf5;border-color:#0f766e;color:#0f766e}
.modalTable td:nth-child(3){max-width:360px;white-space:normal}

.dbActions{margin-left:auto;display:flex;gap:8px;align-items:center;flex-wrap:wrap}.dbActions .btn[disabled]{opacity:.55;cursor:wait}
