/* Copia de pruebas: CSS tomado del sitio original (tema claro nativo; Dark Reader lo oscurece igual en ambos). */
:root{--em-azul:#2563eb;--em-texto:#0f172a;--em-borde:#e2e8f0;--em-th:#f8fafc;--em-radio-btn:9px;--em-ancho-max:1400px}
*{box-sizing:border-box}
html,body{margin:0}
body{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:#f0f4f8;color:#0f172a;display:flex;min-height:100vh}
/* ---- menu lateral (original) ---- */
.em-sidebar{width:220px;height:100vh;flex-shrink:0;background:#0f172a;border-right:none;display:flex;flex-direction:column;position:fixed;top:0;left:0;bottom:0;z-index:100;overflow:hidden;transition:transform .2s}
body.sb-off .em-sidebar{transform:translateX(-220px)}
.em-logo-area{padding:18px 16px 14px;border-bottom:1px solid rgba(255,255,255,.08);display:flex;align-items:center;gap:10px;flex-shrink:0}
.em-logo-area img{max-height:48px;max-width:160px;object-fit:contain}
.em-sb-btn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border-radius:8px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.04);color:#94a3b8;font-size:15px;line-height:1;cursor:pointer;flex-shrink:0}
.em-sb-btn:hover{background:rgba(255,255,255,.1);color:#f1f5f9}
#sb-hide{margin-left:auto}
#sb-show{display:none;position:fixed;top:12px;left:12px;z-index:120;width:36px;height:36px;background:#0f172a;color:#f1f5f9;border-color:#0f172a;box-shadow:0 2px 8px rgba(15,23,42,.25)}
body.sb-off #sb-show{display:inline-flex}
.em-nav{padding:12px 8px;flex:1 1 auto;min-height:0;overflow:hidden auto}
.em-nav::-webkit-scrollbar{width:6px}.em-nav::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12);border-radius:3px}
.em-nav-section{margin-bottom:20px}
.em-nav-label{display:flex;justify-content:space-between;width:100%;background:none;border:0;font:inherit;font-size:10px;font-weight:600;color:#475569;text-transform:uppercase;letter-spacing:.8px;padding:0 8px;margin-bottom:4px;text-align:left;cursor:pointer}
.em-nav-section.closed .items{display:none}
.em-nav-item{display:flex;align-items:center;gap:8px;padding:7px 8px;border-radius:7px;font-size:12.5px;color:#94a3b8;cursor:pointer;transition:.12s;margin-bottom:1px;text-decoration:none}
.em-nav-item:hover{background:rgba(255,255,255,.06);color:#f1f5f9}
.em-nav-item.active{background:rgba(37,99,235,.2);color:#60a5fa;font-weight:500}
.em-nav-icon{font-size:13px;width:16px;text-align:center;flex-shrink:0}
.em-nav-badge{margin-left:auto;flex-shrink:0;min-width:16px;padding:0 5px;border-radius:9px;background:#dc2626;color:#fff;font-size:9.5px;font-weight:700;line-height:16px;text-align:center}
.em-sidebar-footer{padding:12px 16px;border-top:1px solid rgba(255,255,255,.08);display:flex;align-items:center;gap:8px;flex-shrink:0;background:#0f172a}
.em-avatar{width:28px;height:28px;border-radius:50%;background:linear-gradient(135deg,#2563eb,#1d4ed8);display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:600;color:#fff;flex-shrink:0}
.em-footer-name{font-size:12px;font-weight:500;color:#f1f5f9;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px}
.em-footer-role{font-size:10px;color:#475569}
.em-logout-btn{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border-radius:7px;background:rgba(239,68,68,.12);color:#fca5a5;border:1px solid rgba(239,68,68,.28);font:inherit;font-size:11px;font-weight:600;letter-spacing:.2px;cursor:pointer;flex-shrink:0;margin-left:auto}
.em-logout-btn:hover{background:rgba(239,68,68,.22);color:#fecaca}
.em-page-wrap{margin-left:220px;min-height:100vh;width:calc(100% - 220px);padding:24px 28px;transition:margin-left .2s,width .2s}
body.sb-off .em-page-wrap{margin-left:0;width:100%}
/* ---- pagina Rastreo (original) ---- */
.rs{max-width:var(--em-ancho-max,1400px);margin:0 auto;color:#0f172a;font-size:13px;min-width:0}
.rs h1{font-size:24px;margin:0;font-weight:800}
.rs-sub{font-size:13px;color:#64748b;margin:4px 0 12px;line-height:1.5}
.rs-tabs{display:flex;gap:18px;border-bottom:1px solid #e2e8f0;margin-bottom:14px;flex-wrap:wrap}
.rs-tabs button{background:none;border:0;border-bottom:2px solid transparent;padding:8px 2px;font:inherit;font-size:inherit;font-weight:600;color:#64748b;cursor:pointer}
.rs-tabs button.on{color:#2563eb;border-bottom-color:#2563eb}
.panel{display:none}.panel.on{display:block}
.rs-card,.tw,.card{background:#fff;border:1px solid #e2e8f0;border-radius:12px;overflow:hidden;margin-bottom:14px}
.tw{overflow-x:auto}
#map-vivo{height:46vh;min-height:320px;background:#e2e8f0;position:relative;z-index:1}
.rs table{width:100%;border-collapse:collapse;font-size:12.5px;min-width:0}
.rs th{background:#f8fafc;color:#64748b;font-size:11px;text-transform:uppercase;letter-spacing:.03em;text-align:left;padding:9px 10px;white-space:nowrap;border-bottom:1px solid #e2e8f0}
.rs td{padding:9px 10px;border-bottom:1px solid #f1f5f9;vertical-align:top}
.rs tr:last-child td{border-bottom:0}
.rs td.num,.rs th.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.rs tr.clic{cursor:pointer}.rs tr.clic:hover td{background:#f8fafc}.rs tr.sel td{background:#eff6ff}
tr.grey td{opacity:.55}
.rs td .note{display:block;color:#94a3b8;font-size:inherit;line-height:inherit;padding:0;margin:0;max-width:none}
/* chips: .pill/.st son los nombres de la copia, rs-chip los del original */
.pill,.st,.rs-chip{display:inline-block;font-size:11px;font-weight:700;padding:2px 9px;border-radius:9px;white-space:nowrap;background:#fef3c7;color:#b45309;border:0}
.st{background:#f1f5f9;color:#475569}.st.on,.pill.ok{background:#dcfce7;color:#16a34a}.pill.bad{background:#fee2e2;color:#dc2626}
.rs-ok{color:#16a34a;background:#dcfce7}.rs-az{color:#1d4ed8;background:#dbeafe}.rs-gr{color:#475569;background:#f1f5f9}.rs-am{color:#b45309;background:#fef3c7}.rs-ro{color:#dc2626;background:#fee2e2}
.rs h3{font-size:14px;font-weight:700;margin:4px 0 8px}
.note{font-size:12px;color:#64748b;line-height:1.5;padding:0 2px 10px;margin:0;max-width:none}
.msg{color:#64748b;padding:18px}
.rs-gris{color:#94a3b8}
.rs td .pill{white-space:normal}
.card.row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 12px;border-bottom:1px solid #e2e8f0}
.card.row label{display:inline-flex;align-items:center;gap:8px}
.rs input[type=date],.rs input[type=number],.rs select{padding:6px 8px;border:1px solid #cbd5e1;border-radius:9px;font:inherit;background:#fff;color:#0f172a}
.btn,.btn.sec{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 14px;border-radius:9px;font:inherit;font-size:13px;font-weight:600;line-height:1.2;cursor:pointer;white-space:nowrap;background:#fff;color:#0f172a;border:1px solid #e2e8f0}
.btn:hover{background:#f8fafc;border-color:#cbd5e1}
a.lk,button.lk{color:#2563eb;background:none;border:0;cursor:pointer;text-decoration:underline;padding:0;font:inherit}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;padding:12px}
.stat{border:1px solid #e2e8f0;border-radius:10px;padding:9px 11px}.stat span{display:block;font-size:11.5px;color:#64748b}.stat b{font-size:18px;font-variant-numeric:tabular-nums}
.legend{display:flex;gap:14px;flex-wrap:wrap;align-items:center;padding:10px 12px;border-bottom:1px solid #e2e8f0;font-size:12px}.legend i{display:inline-block;width:11px;height:11px;border-radius:50%;margin-right:5px}
.trucks{display:none}
.map{height:52vh;min-height:340px;background:#e2e8f0;position:relative;z-index:1}
.mk{width:24px;height:24px;border-radius:50%;border:2px solid #fff;color:#fff;font:700 11px/20px Inter,sans-serif;text-align:center;box-shadow:0 1px 4px rgba(0,0,0,.35)}
.leaflet-control-layers{border-radius:8px}
/* ---- aviso de copia, ventana de mapa, avisos ---- */
.tools{display:none}
.demo{position:fixed;top:8px;right:14px;z-index:30;background:#fffbeb;color:#92400e;border:1px solid #fcd34d;border-radius:8px;padding:3px 9px;font-size:11px;line-height:1.4;opacity:.92}
#modal{display:none;position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:150;place-items:center}#modal.on{display:grid}
#modal .box{background:#fff;border:1px solid #e2e8f0;border-radius:12px;width:min(720px,92vw);padding:14px}
#modal .map{height:380px;border-radius:10px;margin-top:8px}#modal h4{margin:0;font-size:14px}
#modal .note{padding:8px 2px 0}
#toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);background:#0f172a;color:#f1f5f9;padding:9px 16px;border-radius:8px;opacity:0;pointer-events:none;transition:opacity .2s;z-index:160;font-size:13px}#toast.on{opacity:1}
#fab{position:fixed;right:18px;bottom:18px;width:48px;height:48px;border-radius:50%;border:3px solid #2563eb;background:#0f172a;color:#60a5fa;font-weight:800;cursor:pointer;z-index:90}
@media(max-width:800px){.em-sidebar{transform:translateX(-220px)}body:not(.sb-off) .em-sidebar{transform:none}.em-page-wrap{margin-left:0;width:100%;padding:16px 12px}#sb-show{display:inline-flex}}
