:root{--bg:#0b1016;--panel:#121a23;--panel-soft:#18232f;--panel-strong:#1d2b39;--ink:#f4f7fb;--muted:#91a0b2;--line:rgba(156,174,195,.15);--line-strong:rgba(48,201,137,.42);--green:#30c989;--blue:#5aa7ff;--amber:#f5b942;--red:#f06570;--op-1:#30c989;--op-2:#5aa7ff;--op-3:#f5b942;--op-4:#f06570;--shadow:0 10px 28px rgba(0,0,0,.22);--radius:14px;--radius-sm:10px}
body{padding-left:220px;background:#0b1016;line-height:1.45}.wrapper{max-width:1440px;padding:0 28px 34px}
.sidebar{width:220px;padding:22px 14px;align-items:stretch;background:#0e151d;border-right-color:rgba(156,174,195,.13)}.sidebar-brand{display:flex;align-items:center;gap:12px;min-height:48px;padding:0 12px 22px;font-size:22px;border-bottom:1px solid var(--line)}.sidebar-brand span{display:inline;color:var(--ink);font-size:13px;font-weight:800;letter-spacing:.12em}.sidebar-nav{margin-top:18px;gap:7px}.nav-link{min-height:48px;padding:0 14px;display:flex;justify-content:flex-start;place-items:center;gap:12px;border-radius:10px;font-size:12px;color:#9aa9ba}.nav-link i{width:20px;font-size:16px;text-align:center}.nav-link span{font-size:12px}.nav-link:hover{background:rgba(255,255,255,.04);color:var(--ink)}.nav-link.active{background:linear-gradient(90deg,rgba(48,201,137,.18),rgba(48,201,137,.06));border-color:rgba(48,201,137,.25);color:#7ee8b8}
.header{min-height:82px;margin:0 -28px 18px;padding:14px 28px;border-bottom:1px solid var(--line);background:rgba(11,16,22,.96)}.logo{gap:12px}.logo>i{font-size:24px}.logo h1{font-size:18px}.logo span{font-size:11px;color:var(--muted)}.header-right{gap:10px}.update-box{padding:8px 12px;background:var(--panel)}.update-box strong{font-size:12px}#btnRefresh{min-height:42px;padding:0 16px;border-radius:10px;box-shadow:none}
.toolbar{margin:0 0 18px;padding:12px 14px;border-radius:12px;box-shadow:none;background:rgba(18,26,35,.72)}.linked-file{padding:5px 8px;border:0;background:transparent}.linked-file strong{font-size:12px}.status-box{min-height:36px;padding:0 12px;border-radius:999px}.status-text{font-size:11px}#btnExport{min-height:38px;border-radius:9px}
.view-heading{align-items:center;margin:22px 0 16px;padding:0}.breadcrumb{font-size:9px;letter-spacing:.1em}.view-heading h2{margin-top:5px;font-size:clamp(22px,2.4vw,30px);letter-spacing:-.025em}.view-heading p{margin-top:4px;max-width:620px;font-size:12px}.secondary-button{min-height:40px;padding:0 14px;background:var(--panel)}
.insight-strip{gap:10px;margin:0 0 14px}.insight-card{min-height:76px;padding:13px 15px;background:var(--panel)}.insight-card span{margin-bottom:6px;font-size:9px;letter-spacing:.06em}.insight-card strong{font-size:13px}
.filters{position:relative;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px;margin:0 0 10px;padding:16px;border-radius:12px;box-shadow:none;background:var(--panel)}.search-group{grid-column:span 2}.filter-group label{margin-bottom:6px;font-size:9px;color:#aab6c5}.filter-group select,.filter-group input,#btnClear{min-height:42px;border-radius:9px}#btnClear{width:100%}.filter-chips{margin:0 0 16px}.filter-chip{padding:7px 11px}
.kpi-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}.kpi-card{grid-column:span 2;min-height:138px;padding:17px;border-radius:13px;box-shadow:none}.kpi-card:nth-child(4),.kpi-card:nth-child(5){grid-column:span 3}.kpi-header span{font-size:10px}.kpi-icon{width:34px;height:34px}.kpi-value{margin:14px 0 10px;font-size:clamp(25px,2.7vw,34px);letter-spacing:-.04em}.kpi-footer{gap:8px}.kpi-change,.kpi-info{font-size:10px}
.alerts-card,.chart-card,.performance-card,.table-card,.panel{border-radius:13px;box-shadow:none;background:var(--panel)}.alerts-card{margin-top:16px}.alerts-header h2{font-size:17px}.alert-item,.alerts-ok{border-radius:10px;background:rgba(255,255,255,.025)}.charts{gap:14px}.chart-card{min-height:500px;padding:16px}.chart-body{height:270px}.chart-header{padding-bottom:12px}.chart-footer{padding-top:10px}.performance-grid{grid-template-columns:repeat(auto-fit,minmax(270px,1fr))}.table-card{padding:18px}.table-header{margin-bottom:12px}.side-panels{gap:14px}
table.dataTable thead th{padding:13px 10px;background:var(--panel-soft);font-size:10px}table.dataTable tbody td{padding:12px 10px;font-size:11px}table.dataTable tbody tr{background:transparent}.dataTables_wrapper .bottom{margin-top:14px}.status{margin-top:16px;border-radius:10px;color:var(--muted)}footer{margin-top:14px;color:var(--muted)}
table.dataTable tbody tr.row-type-carga{box-shadow:inset 3px 0 0 #10b981}table.dataTable tbody tr.row-type-lectura{box-shadow:inset 3px 0 0 #38bdf8}table.dataTable tbody tr.row-type-incompleto{box-shadow:inset 3px 0 0 #ef4444;background:rgba(239,68,68,.06)}
@media(max-width:1180px){body{padding-left:190px}.sidebar{width:190px}.filters{grid-template-columns:repeat(3,minmax(140px,1fr))}.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.kpi-card,.kpi-card:nth-child(4),.kpi-card:nth-child(5){grid-column:span 1}.kpi-card:first-child{grid-column:span 2}}
@media(max-width:700px){body{padding-left:0;padding-bottom:72px}.wrapper{padding:0 12px 24px}.sidebar{width:100%;height:64px;padding:5px 7px}.sidebar-nav{margin:0;gap:2px}.nav-link{min-height:50px;padding:3px;justify-content:center;flex-direction:column;gap:2px}.nav-link i{width:auto;font-size:15px}.nav-link span{font-size:8px}.header{margin:0 -12px 12px;padding:14px 12px;min-height:0}.header-right{display:grid;grid-template-columns:1fr 1fr;gap:8px}.update-box,#btnRefresh{width:100%}.logo h1{font-size:15px}.toolbar{padding:12px}.toolbar-left,.toolbar-right{width:100%}.toolbar-right{gap:8px}.linked-file{width:100%}.linked-file strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:280px}.view-heading{margin:18px 0 12px}.view-heading h2{font-size:21px}.insight-strip{grid-template-columns:1fr 1fr}.insight-card{min-height:72px}.filters{grid-template-columns:1fr;padding:13px}.search-group{grid-column:auto}.kpi-grid{grid-template-columns:1fr 1fr}.kpi-card,.kpi-card:first-child,.kpi-card:nth-child(4),.kpi-card:nth-child(5){grid-column:span 1;min-height:125px}.kpi-card:first-child{grid-column:1/-1}.kpi-value{font-size:26px}.kpi-footer{align-items:flex-start;flex-direction:column}.chart-card{min-height:auto;padding:13px}.chart-body{height:240px}.alerts-card,.performance-card,.table-card,.panel{padding:14px}}
@media(max-width:420px){.insight-strip,.kpi-grid{grid-template-columns:1fr}.kpi-card,.kpi-card:first-child,.kpi-card:nth-child(4),.kpi-card:nth-child(5){grid-column:1}.header-right{grid-template-columns:1fr}}

/* Identidad visual y experiencia PWA */
.brand-mark{display:block;width:36px;height:36px;flex:none;filter:drop-shadow(0 5px 12px rgba(48,201,137,.24))}.brand-mark--header{width:42px;height:42px}.brand-mark--loader{width:70px;height:70px}.brand-mark--footer{width:24px;height:24px}.loader-logo{display:grid;place-items:center;background:transparent}.logo{min-width:0}.logo h1{white-space:normal}.install-button{min-height:42px;padding:0 15px;display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid rgba(90,167,255,.42);border-radius:10px;background:rgba(90,167,255,.1);color:#dbeaff;font:700 11px var(--font);cursor:pointer;transition:.2s ease}.install-button:hover,.install-button.install-ready{border-color:var(--blue);background:rgba(90,167,255,.2);box-shadow:0 0 18px rgba(90,167,255,.14)}.install-button[hidden]{display:none!important}.table-card{overflow:hidden}.dataTables_wrapper{overflow-x:auto;scrollbar-gutter:stable}.nav-link,.secondary-button,#btnRefresh,#btnExport,#btnClear,.install-button{touch-action:manipulation}

@media(max-width:1180px){.header{align-items:flex-start}.header-right{flex-wrap:wrap;justify-content:flex-end}.install-button{order:3}.operator-key small{white-space:normal}}
@media(max-width:850px){body{padding-left:82px}.sidebar{width:82px;padding:18px 9px}.sidebar-brand{justify-content:center;padding:0 0 18px}.sidebar-brand span{display:none}.sidebar-nav{gap:5px}.nav-link{justify-content:center;padding:6px;flex-direction:column;gap:2px}.nav-link i{width:auto}.nav-link span{font-size:9px}.wrapper{padding-left:18px;padding-right:18px}.header{margin-left:-18px;margin-right:-18px;padding-left:18px;padding-right:18px}.charts{grid-template-columns:1fr}.chart-card{min-height:auto}.operator-legend__items{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){body{padding-left:0;padding-bottom:calc(72px + env(safe-area-inset-bottom))}.sidebar{height:calc(64px + env(safe-area-inset-bottom));padding-bottom:calc(5px + env(safe-area-inset-bottom))}.logo{align-items:center}.brand-mark--header{width:38px;height:38px}.header{align-items:stretch;gap:12px}.header-right{grid-template-columns:1fr 1fr}.install-button{grid-column:1/-1;width:100%}.operator-legend__items{grid-template-columns:1fr 1fr}.operator-key{min-width:0}.operator-key small{white-space:normal}.toolbar-right{width:100%;flex-wrap:wrap}.status-box{flex:1;min-width:210px}.chart-body{height:230px}.unit-drawer{padding-bottom:calc(28px + env(safe-area-inset-bottom))}}
@media(max-width:480px){.wrapper{padding-left:10px;padding-right:10px}.header{margin-left:-10px;margin-right:-10px;padding-left:10px;padding-right:10px}.logo h1{font-size:14px}.logo span{font-size:9px}.update-box small{font-size:8px}.update-box strong{font-size:10px}#btnRefresh,.install-button{font-size:10px}.operator-legend__items{grid-template-columns:1fr}.insight-card strong{font-size:12px}.chart-body{height:210px}.table-card{padding:10px}}

/* Filtros compactos y panel móvil */
.mobile-filter-header{display:none}.filter-toggle{gap:7px}.filter-count{display:grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:var(--green);color:#062018;font-size:10px}.filter-count[hidden]{display:none}.filters{grid-template-columns:repeat(5,minmax(130px,1fr));gap:9px;padding:12px}.filters .filter-group{gap:4px}.filters .filter-group label{margin:0;font-size:8px}.filters .filter-group select,.filters .filter-group input,.filters #btnClear{min-height:36px;height:36px;padding-left:9px;padding-right:9px}.filters .search-group{grid-column:span 2}
@media(max-width:700px){body.filters-open{overflow:hidden}.filters{position:fixed;z-index:280;left:8px;right:8px;bottom:calc(68px + env(safe-area-inset-bottom));display:grid;grid-template-columns:1fr 1fr;gap:8px;max-height:min(68dvh,560px);margin:0;padding:12px;overflow-y:auto;overscroll-behavior:contain;border-color:rgba(37,216,192,.38);border-radius:16px;box-shadow:0 -18px 55px rgba(0,0,0,.5)}.filters.collapsed{display:none}.mobile-filter-header{display:flex;grid-column:1/-1;align-items:center;justify-content:space-between;gap:12px;padding:0 0 8px;border-bottom:1px solid var(--line)}.mobile-filter-header strong,.mobile-filter-header small{display:block}.mobile-filter-header strong{font-size:13px}.mobile-filter-header small{margin-top:2px;color:var(--muted);font-size:9px}.mobile-filter-header button{width:34px;height:34px;border:1px solid var(--line);border-radius:9px;background:var(--panel-soft);color:var(--ink)}.filters .search-group{grid-column:1/-1}.filters .filter-group:last-child{grid-column:1/-1}.filters .filter-group label{font-size:8px}.filters .filter-group select,.filters .filter-group input,.filters #btnClear{min-height:36px;height:36px;font-size:11px}.filter-chips{display:flex;flex-wrap:nowrap;gap:6px;margin:0 0 10px;padding-bottom:3px;overflow-x:auto;scrollbar-width:none}.filter-chips::-webkit-scrollbar{display:none}.filter-chip{flex:none;max-width:78vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.filter-toggle{min-height:36px;padding:0 11px}}
