[hidden]{display:none!important}
:root{
  --navy:#14264a; --navy-2:#223d70; --orange:#c8551b; --orange-soft:#fbeee6;
  --bg:#f4f6fa; --card:#ffffff; --text:#1a2233; --muted:#667085; --border:#e2e7ef;
  --ok:#1f8a5b; --warn:#c88a12; --info:#2f6fd6;
  --radius:14px; --shadow:0 1px 2px rgba(16,24,40,.06),0 2px 8px rgba(16,24,40,.05);
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--text);font-family:Lato,system-ui,sans-serif;font-size:15px}
h1,h2,h3,h4{font-family:Poppins,system-ui,sans-serif;margin:0;color:var(--navy)}
h1{font-size:1.45rem} h2{font-size:1.15rem} h3{font-size:1rem}
button,input,select,textarea{font:inherit}
a{color:inherit}
.app{display:flex;min-height:100vh}
/* Sidebar */
.side{width:240px;background:var(--navy);color:#fff;display:flex;flex-direction:column;padding:20px 14px;position:sticky;top:0;height:100vh;flex-shrink:0}
.brand{display:flex;align-items:center;gap:10px;padding:0 6px 20px;border-bottom:1px solid rgba(255,255,255,.12);margin-bottom:12px}
.logo{width:40px;height:40px;border-radius:10px;background:#fff;color:var(--navy);display:grid;place-items:center;font-family:Poppins;font-weight:700;overflow:hidden;flex-shrink:0}
.logo img{width:100%;height:100%;object-fit:contain}
.brand b{font-family:Poppins;font-size:.95rem;display:block}
.brand small{opacity:.7;font-size:.78rem}
.nav a{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:10px;text-decoration:none;color:rgba(255,255,255,.82);cursor:pointer;margin-bottom:2px}
.nav a:hover{background:rgba(255,255,255,.08)}
.nav a.on{background:var(--orange);color:#fff}
.nav svg{width:18px;height:18px}
.side .new{margin-top:auto}
/* Main */
main{flex:1;min-width:0;padding:24px 28px 100px}
.top{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:20px;flex-wrap:wrap}
.muted{color:var(--muted)}
.card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px}
.grid{display:grid;gap:16px}
.g4{grid-template-columns:repeat(4,1fr)} .g3{grid-template-columns:repeat(3,1fr)} .g2{grid-template-columns:repeat(2,1fr)}
.kpi .n{font-family:Poppins;font-size:1.7rem;font-weight:700;color:var(--navy)}
.kpi .l{color:var(--muted);font-size:.85rem}
.delta{font-size:.8rem;font-weight:700;margin-left:6px}
.up{color:var(--ok)} .down{color:#c0392b}
.btn{border:0;border-radius:10px;padding:10px 16px;cursor:pointer;font-weight:700;display:inline-flex;align-items:center;gap:8px;background:var(--navy);color:#fff}
.btn.or{background:var(--orange)} .btn.gh{background:#fff;color:var(--navy);border:1px solid var(--border)}
.btn.sm{padding:6px 10px;font-size:.85rem}
.btn:disabled{opacity:.5;cursor:default}
.chip{display:inline-block;padding:3px 9px;border-radius:999px;font-size:.75rem;font-weight:700;background:#eef2f8;color:var(--navy-2)}
.st-Completado{background:#e5f5ee;color:var(--ok)} .st-En\ progreso{background:#fdf3dd;color:var(--warn)} .st-Continuo{background:#e6eefc;color:var(--info)}
.pr-Alta{background:#fde8e6;color:#b42318} .pr-Media{background:#fdf3dd;color:var(--warn)} .pr-Baja{background:#eef2f8;color:var(--muted)}
.star{color:var(--orange)}
.list .item{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--border);align-items:flex-start}
.list .item:last-child{border-bottom:0}
.thumb svg{width:22px;height:22px}.thumb{width:56px;height:56px;border-radius:10px;object-fit:cover;flex-shrink:0;background:#eef2f8}
.item .t{font-weight:700} .item .s{color:var(--muted);font-size:.85rem;margin-top:2px}
.counters{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.counter{border:1px dashed var(--border);border-radius:12px;padding:14px;display:flex;justify-content:space-between;align-items:center;background:#fff}
.counter .n{font-family:Poppins;font-size:1.3rem;font-weight:700;color:var(--navy)}
.plus{width:38px;height:38px;border-radius:50%;border:0;background:var(--orange);color:#fff;font-size:1.3rem;cursor:pointer}
label.f{display:block;font-size:.82rem;font-weight:700;color:var(--muted);margin-bottom:4px}
input.i,select.i,textarea.i{width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:#fff;color:var(--text)}
textarea.i{min-height:90px;resize:vertical}
.fgrid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.full{grid-column:1/-1}
.toggle{display:flex;align-items:center;gap:8px;cursor:pointer;font-weight:700}
.photos{display:flex;flex-wrap:wrap;gap:10px;margin-top:8px}
.ph{width:110px}
.ph img{width:110px;height:84px;object-fit:cover;border-radius:10px;display:block}
.ph select{width:100%;margin-top:4px;padding:4px;border-radius:8px;border:1px solid var(--border);font-size:.8rem}
.drop{border:2px dashed var(--border);border-radius:12px;padding:18px;text-align:center;color:var(--muted);cursor:pointer;background:#fafbfd}
.filters{display:grid;grid-template-columns:2fr repeat(4,1fr);gap:10px;margin-bottom:14px}
.cal{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
.cal .h{text-align:center;font-size:.78rem;color:var(--muted);font-weight:700;padding:4px}
.day{aspect-ratio:1/1;border-radius:10px;border:1px solid var(--border);background:#fff;padding:6px;cursor:pointer;display:flex;flex-direction:column;justify-content:space-between;font-size:.85rem}
.day.out{opacity:.35}
.day.sel{outline:2px solid var(--orange)}
.day.today{border-color:var(--navy);font-weight:700}
.dots{display:flex;gap:3px;flex-wrap:wrap}
.dot{width:7px;height:7px;border-radius:50%;background:var(--navy)}
.dot.c{background:var(--orange)}
.lv1{background:#eef3fb}.lv2{background:#d8e4f7}.lv3{background:#b9cdef}
.prog{height:8px;background:#eef2f8;border-radius:99px;overflow:hidden}
.prog i{display:block;height:100%;background:var(--orange)}
/* Report */
.rep-controls{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin-bottom:16px}
.rep-controls>div{min-width:140px}
.sheet{background:#fff;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.cover{background:linear-gradient(135deg,var(--navy),var(--navy-2));color:#fff;padding:36px 32px;position:relative}
.cover h1{color:#fff;font-size:1.8rem}
.cover .bar{width:60px;height:5px;background:var(--orange);border-radius:4px;margin:14px 0}
.cover .logo{position:absolute;right:28px;top:28px;width:64px;height:64px}
.rsec{padding:24px 32px;border-top:1px solid var(--border)}
.rsec-h{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px;flex-wrap:wrap}
.rsec-h h2{display:flex;align-items:center;gap:10px}
.rsec-h h2:before{content:"";width:5px;height:22px;background:var(--orange);border-radius:3px}
.num{color:var(--orange);font-family:Poppins}
.narr{width:100%;overflow:hidden;border:1px dashed var(--border);border-radius:10px;padding:12px;min-height:70px;background:#fbfcfe;resize:vertical;line-height:1.5}
.dest{display:grid;grid-template-columns:1fr 1.2fr;gap:18px;padding:16px;border:1px solid var(--border);border-radius:12px;margin-top:12px}
.dest.off{opacity:.45}
.pgrid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.pgrid label{position:relative;cursor:pointer}
.pgrid img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:8px;display:block}
.pgrid input{position:absolute;top:6px;left:6px;width:18px;height:18px;accent-color:var(--orange)}
.pgrid .tag{position:absolute;bottom:6px;left:6px;background:rgba(20,38,74,.85);color:#fff;font-size:.7rem;padding:2px 6px;border-radius:6px;text-transform:capitalize}
.pgrid label.excl img{filter:grayscale(1);opacity:.4}
.bars .row{display:grid;grid-template-columns:150px 1fr 40px;gap:10px;align-items:center;margin:7px 0;font-size:.85rem}
.bars .tr{height:14px;background:#eef2f8;border-radius:99px;overflow:hidden}
.bars .tr i{display:block;height:100%;background:var(--navy);border-radius:99px}
.bars .tr i.o{background:var(--orange)}
.vbars{display:flex;align-items:flex-end;gap:14px;height:150px;padding-top:10px}
.vbars .c{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;font-size:.8rem}
.vbars .b{width:100%;max-width:46px;background:var(--navy);border-radius:8px 8px 0 0}
.stack{display:flex;height:22px;border-radius:99px;overflow:hidden;margin:10px 0}
.stack i{display:block;height:100%}
table.t{width:100%;border-collapse:collapse;font-size:.88rem}
table.t th{background:var(--navy);color:#fff;text-align:left;padding:10px;font-weight:700}
table.t td{padding:9px 10px;border-bottom:1px solid var(--border)}
table.t tr:nth-child(even) td{background:#f6f8fc}
.ai{display:inline-flex;align-items:center;gap:6px;font-size:.75rem;color:var(--muted)}
.export{position:sticky;bottom:0;background:rgba(244,246,250,.95);backdrop-filter:blur(6px);padding:12px 0;display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:16px}
.toast{position:fixed;left:50%;bottom:90px;transform:translateX(-50%) translateY(20px);background:var(--navy);color:#fff;padding:12px 18px;border-radius:12px;opacity:0;transition:.25s;z-index:99;max-width:90vw;text-align:center}
.toast.show{opacity:1;transform:translateX(-50%)}
.proto{background:var(--orange-soft);color:var(--orange);font-weight:700;font-size:.78rem;padding:4px 10px;border-radius:99px}
.mv{display:flex;gap:4px}
.icon-btn{border:1px solid var(--border);background:#fff;border-radius:8px;width:30px;height:30px;cursor:pointer;color:var(--navy)}
/* Mobile */
.bnav{display:none}
.sheetmenu{display:none}
@media (max-width:900px){
  .side{display:none}
  main{padding:16px 16px 110px}
  .g4{grid-template-columns:repeat(2,1fr)} .g3,.g2{grid-template-columns:1fr}
  .fgrid{grid-template-columns:1fr}
  .filters{grid-template-columns:1fr 1fr}
  .filters input[type=search]{grid-column:1/-1}
  .dest{grid-template-columns:1fr}
  .rsec{padding:18px 16px} .cover{padding:28px 18px}
  .bars .row{grid-template-columns:100px 1fr 30px}
  .bnav{display:flex;position:fixed;bottom:0;left:0;right:0;background:var(--navy);padding:8px 6px calc(8px + env(safe-area-inset-bottom));justify-content:space-around;z-index:50}
  .bnav a{color:rgba(255,255,255,.75);text-decoration:none;display:flex;flex-direction:column;align-items:center;font-size:.7rem;gap:3px;cursor:pointer;flex:1}
  .bnav a.on{color:#fff}
  .bnav svg{width:22px;height:22px}
  .bnav .fab{width:52px;height:52px;border-radius:50%;background:var(--orange);display:grid;place-items:center;margin-top:-26px;box-shadow:0 4px 12px rgba(0,0,0,.25)}
  .sheetmenu.open{display:block;position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:60}
  .sheetmenu .in{position:absolute;bottom:0;left:0;right:0;background:#fff;border-radius:18px 18px 0 0;padding:14px 16px 30px}
  .sheetmenu a{display:flex;gap:12px;align-items:center;padding:14px 8px;border-bottom:1px solid var(--border);cursor:pointer;text-decoration:none;color:var(--navy);font-weight:700}
  .sheetmenu svg{width:20px;height:20px}
}

/* ---------- Añadidos versión real ---------- */
.login{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,var(--navy),var(--navy-2));padding:24px max(16px,env(safe-area-inset-right,0px)) 24px max(16px,env(safe-area-inset-left,0px))}
.login form{background:#fff;border-radius:18px;padding:30px 26px;width:100%;max-width:380px;box-shadow:0 20px 50px rgba(0,0,0,.25)}
.login .logo{margin-bottom:14px;background:var(--navy);color:#fff}
.login h1{margin-bottom:4px}
.login .f{margin-top:14px}
.err{color:#b42318;font-size:.88rem;margin-top:10px;min-height:1.2em}
.banner{background:var(--orange-soft);color:var(--orange);font-weight:700;font-size:.85rem;padding:8px 14px;border-radius:10px;margin-bottom:14px}
.btn.danger{background:#fff;color:#b42318;border:1px solid #f3c7c2}
.ph{position:relative}
.ph .x{position:absolute;top:4px;right:4px;width:24px;height:24px;border-radius:50%;border:0;background:rgba(20,38,74,.85);color:#fff;cursor:pointer;font-size:.9rem;line-height:1}
.ph.off img{opacity:.35}
.ph label.mini{display:flex;align-items:center;gap:4px;font-size:.75rem;margin-top:4px;color:var(--muted)}
.loading{position:fixed;inset:0;display:grid;place-items:center;background:rgba(244,246,250,.85);z-index:90;font-weight:700;color:var(--navy)}
.spin{width:36px;height:36px;border-radius:50%;border:4px solid #d8e0ee;border-top-color:var(--orange);animation:sp 1s linear infinite;margin:0 auto 12px}
@keyframes sp{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.spin{animation-duration:3s}}
.item.click{cursor:pointer}
.item.click:hover{background:#fafbfd}
.empty{color:var(--muted);padding:22px;text-align:center}
.inline-form{display:grid;grid-template-columns:2fr 1.2fr 1fr 1fr 1.4fr auto;gap:10px}
@media (max-width:900px){.inline-form{grid-template-columns:1fr 1fr}.inline-form .btn{grid-column:1/-1}}
.btn:focus-visible,.icon-btn:focus-visible,.plus:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--orange);outline-offset:2px}
.minus{border:0;background:none;color:var(--muted);font-size:.78rem;cursor:pointer;padding:0;margin-top:2px;text-decoration:underline}
