/* RENOVA — Design system (Fase 2). Paleta tomada del logo. Light por defecto + dark completo. */
[data-theme="light"] {
  --bg-primary:#FFFFFF; --bg-secondary:#F2F6F8; --bg-tertiary:#E4ECF0;
  --text-primary:#0B1D2B; --text-secondary:#3E5464; --text-muted:#5F7381;
  --border:#CFDBE2; --border-soft:#E3EBF0; --brand-navy:#022541; --brand-petrol:#014663;
  --accent:#087A85; --accent-hover:#06646D; --accent-bright:#24C9CB; --accent-text:#FFFFFF;
  --accent-soft:rgba(8,122,133,.12);
  --danger:#B3261E; --success:#1A7A4A; --warning:#9A5B00; --warning-soft:rgba(154,91,0,.1);
  --surface:#FFFFFF; --shadow:rgba(2,37,65,.08); --shadow-strong:rgba(2,37,65,.18);
  --side-bg:#022541; --side-text:#C9D8E2; --side-active:#FFFFFF;
  --sec-neuro:#014663; --sec-neuro-soft:rgba(1,70,99,.1);
  --sec-vertigo:#087A85; --sec-vertigo-soft:rgba(8,122,133,.12);
  --sec-columna:#4A6075; --sec-columna-soft:rgba(74,96,117,.13);
  --skel-a:#E4ECF0; --skel-b:#F2F6F8;
}
[data-theme="dark"] {
  --bg-primary:#0A1824; --bg-secondary:#07131D; --bg-tertiary:#142838;
  --text-primary:#EAF2F6; --text-secondary:#A9BCC8; --text-muted:#8AA0AE;
  --border:#203747; --border-soft:#183040; --brand-navy:#EAF2F6; --brand-petrol:#7FD3DC;
  --accent:#24C9CB; --accent-hover:#3ED8DA; --accent-bright:#24C9CB; --accent-text:#03202B;
  --accent-soft:rgba(36,201,203,.14);
  --danger:#F2726B; --success:#3DBE7A; --warning:#E8A23A; --warning-soft:rgba(232,162,58,.13);
  --surface:#0D1D2A; --shadow:rgba(0,0,0,.45); --shadow-strong:rgba(0,0,0,.6);
  --side-bg:#051220; --side-text:#A9BCC8; --side-active:#FFFFFF;
  --sec-neuro:#6FB6D8; --sec-neuro-soft:rgba(111,182,216,.14);
  --sec-vertigo:#24C9CB; --sec-vertigo-soft:rgba(36,201,203,.14);
  --sec-columna:#B3C1CE; --sec-columna-soft:rgba(179,193,206,.13);
  --skel-a:#142838; --skel-b:#1B3347;
}
*,*::before,*::after{box-sizing:border-box;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
input,textarea,select,[contenteditable="true"]{-webkit-user-select:text;user-select:text}
html,body{margin:0}
html{-webkit-text-size-adjust:100%}
body{font-family:Inter,system-ui,sans-serif;font-size:15px;line-height:1.6;background:var(--bg-secondary);color:var(--text-primary);min-height:100vh;overflow-x:hidden}
a{color:var(--accent)}
img{max-width:100%}
button{cursor:pointer;font:inherit;color:inherit}
h1,h2,h3,h4{font-weight:600;margin:0;line-height:1.25;color:var(--text-primary)}
h1{font-size:28px} h2{font-size:22px} h3{font-size:18px} h4{font-size:15px}
p{margin:0}
.label{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--text-muted);font-weight:600}
.muted{color:var(--text-muted)} .sec-txt{color:var(--text-secondary)}
[data-lucide]{width:20px;height:20px;stroke-width:1.8;flex-shrink:0}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
:focus-visible{outline:2px solid var(--accent-bright);outline-offset:2px}

/* Matices por sección clínica (consistentes en todo el sistema) */
.sec-neuro{--sec:var(--sec-neuro);--sec-soft:var(--sec-neuro-soft)}
.sec-vertigo{--sec:var(--sec-vertigo);--sec-soft:var(--sec-vertigo-soft)}
.sec-columna{--sec:var(--sec-columna);--sec-soft:var(--sec-columna-soft)}
.chip-sec{display:inline-flex;align-items:center;gap:.4rem;padding:.2rem .65rem .2rem .5rem;border-radius:4px 12px 12px 12px;
  background:var(--sec-soft,var(--bg-tertiary));color:var(--sec,var(--text-secondary));font-size:13px;font-weight:600;line-height:1.5;white-space:nowrap}
.chip-sec [data-lucide]{width:15px;height:15px}
.chip{display:inline-flex;align-items:center;gap:.35rem;padding:.2rem .6rem;border-radius:999px;background:var(--bg-tertiary);color:var(--text-secondary);font-size:13px;font-weight:500}
.chip-warn{background:var(--warning-soft);color:var(--warning)}

/* Ripple + micro-interacciones */
button,.btn,.ripple-target{position:relative;overflow:hidden;transition:transform .1s ease,opacity .1s ease,background .15s}
button:active,.btn:active,.clickeable:active,.ripple-target:active{transform:scale(.96);opacity:.92}
.ripple-wave{position:absolute;border-radius:50%;background:rgba(255,255,255,.35);transform:scale(0);animation:ripple-anim .6s linear;pointer-events:none}
.btn-ghost .ripple-wave,.icon-btn .ripple-wave,.rol-chip .ripple-wave,.nav-item .ripple-wave{background:rgba(2,37,65,.14)}
[data-theme="dark"] .btn-ghost .ripple-wave,[data-theme="dark"] .icon-btn .ripple-wave,[data-theme="dark"] .rol-chip .ripple-wave{background:rgba(255,255,255,.22)}
.sidebar .ripple-wave,.btn-light .ripple-wave{background:rgba(255,255,255,.22)}
.btn-light .ripple-wave{background:rgba(2,37,65,.16)}
@keyframes ripple-anim{to{transform:scale(4);opacity:0}}
.scrollable{-webkit-overflow-scrolling:touch}

/* Botones */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;min-height:46px;padding:.7rem 1.25rem;border-radius:12px 12px 12px 4px;
  border:1px solid transparent;font-weight:600;font-size:15px;text-decoration:none;line-height:1.2}
.btn-primary{background:var(--accent);color:var(--accent-text)}
.btn-primary:hover{background:var(--accent-hover)}
.btn-ghost{background:var(--bg-primary);color:var(--text-primary);border-color:var(--border)}
.btn-light{background:#fff;color:#022541}
.btn-outline-light{background:rgba(255,255,255,.08);color:#fff;border-color:rgba(255,255,255,.4)}
.btn-danger{background:var(--danger);color:#fff}
.btn-sm{min-height:44px;padding:.5rem .9rem;font-size:14px}
.btn-block{width:100%}
.btn[disabled]{opacity:.6;pointer-events:none}
.icon-btn{position:relative;width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;border-radius:12px;
  border:1px solid var(--border);background:var(--bg-primary);color:var(--text-primary);flex-shrink:0}
[data-theme="light"] .icon-dark,[data-theme="dark"] .icon-light{display:none}
.js-install{display:none}
.js-install.visible{display:inline-flex}

/* Formularios */
.field{display:flex;flex-direction:column;gap:.35rem;margin-bottom:1rem}
.field input,.field select,.field textarea{min-height:48px;padding:.7rem .9rem;border-radius:12px;border:1px solid var(--border);background:var(--bg-primary);
  color:var(--text-primary);font-size:16px;outline:none;width:100%;font-family:inherit}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.field .hint{font-size:12px;color:var(--text-muted)}
.password-field{position:relative}
.password-field input{padding-right:3rem}
.toggle-password{position:absolute;right:2px;top:50%;transform:translateY(-50%);width:44px;height:44px;border:none;background:none;color:var(--text-muted);display:flex;align-items:center;justify-content:center;border-radius:12px}
.toggle-password:active{transform:translateY(-50%) scale(.92)}

/* Layout */
.vista{animation:slideIn .28s cubic-bezier(.4,0,.2,1)}
@keyframes slideIn{from{opacity:0;transform:translateX(16px)}to{opacity:1;transform:none}}
.wrap{max-width:1200px;margin:0 auto;padding:2rem 1.5rem}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}.ripple-wave{display:none}}

/* Topbar público */
.topbar{position:sticky;top:0;z-index:50;display:flex;align-items:center;justify-content:space-between;gap:1rem;
  padding:.65rem 1.5rem;padding-top:calc(.65rem + env(safe-area-inset-top));background:var(--bg-primary);border-bottom:1px solid var(--border)}
.brand{display:flex;align-items:center;gap:.65rem;text-decoration:none;color:inherit;min-width:0}
.brand img{border-radius:8px;background:#fff;flex-shrink:0}
.brand-txt{display:flex;flex-direction:column;line-height:1.15;min-width:0}
.brand-txt strong{font-size:17px;letter-spacing:.08em;text-transform:uppercase;color:var(--brand-navy)}
.brand-txt small{font-size:12px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar-actions{display:flex;align-items:center;gap:.5rem}
body.has-shell .topbar{display:none}

/* Skeleton */
.skel{display:block;border-radius:8px;background:linear-gradient(90deg,var(--skel-a),var(--skel-b),var(--skel-a));background-size:200% 100%;animation:skel 1.3s linear infinite}
@keyframes skel{to{background-position:-200% 0}}

/* Estados */
.empty-state,.error-state{text-align:center;padding:2.25rem 1.25rem;display:flex;flex-direction:column;align-items:center;gap:.5rem}
.empty-state .ico,.error-state .ico{width:56px;height:56px;border-radius:4px 18px 18px 18px;background:var(--accent-soft);color:var(--accent);display:flex;align-items:center;justify-content:center;margin-bottom:.4rem}
.error-state .ico{background:var(--warning-soft);color:var(--warning)}
.empty-state .ico [data-lucide],.error-state .ico [data-lucide]{width:26px;height:26px}
.empty-state p,.error-state p{color:var(--text-secondary);max-width:380px}
.empty-state .btn,.error-state .btn{margin-top:.6rem}
.empty-mini{padding:1.25rem .5rem}

/* Cards / paneles */
.panel-card{background:var(--bg-primary);border:1px solid var(--border);border-radius:4px 20px 20px 20px;padding:1.5rem}
.panel-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:1rem;margin-bottom:1.5rem}
.card-title{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:1rem}
.card-title h3{font-size:16px}
.divider{height:1px;background:var(--border-soft);margin:1rem 0}

/* KPI */
.kpis{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:1.25rem}
.kpi{flex:1 1 170px;position:relative;background:var(--bg-primary);border:1px solid var(--border);border-radius:4px 20px 20px 20px;padding:1.1rem 1.2rem 1.1rem 1.5rem;overflow:hidden}
.kpi::before{content:"";position:absolute;left:0;top:0;bottom:0;width:5px;background:var(--kpi-c,var(--accent))}
.kpi .num{font-size:38px;font-weight:700;line-height:1.1;letter-spacing:-.02em;color:var(--text-primary);font-variant-numeric:tabular-nums}
.kpi .lbl{display:flex;align-items:center;gap:.4rem;margin-top:.35rem;font-size:13px;color:var(--text-secondary)}
.kpi .lbl [data-lucide]{width:16px;height:16px;color:var(--kpi-c,var(--accent))}
.kpi.warn{--kpi-c:var(--warning)}

/* Grillas de panel asimétricas */
.dash-grid{display:flex;flex-wrap:wrap;gap:1.25rem;align-items:flex-start}
.dash-main{flex:2 1 460px;min-width:0;display:flex;flex-direction:column;gap:1.25rem}
.dash-side{flex:1 1 300px;min-width:0;display:flex;flex-direction:column;gap:1.25rem}

/* Distribución por sección */
.seg-bar{display:flex;height:14px;border-radius:7px;overflow:hidden;background:var(--bg-tertiary);gap:2px}
.seg-bar span{display:block;height:100%;background:var(--sec);min-width:4px;transition:width .5s}
.seg-list{display:flex;flex-direction:column;margin-top:1rem}
.seg-row{display:flex;align-items:center;gap:.75rem;padding:.65rem 0;border-top:1px solid var(--border-soft)}
.seg-row:first-child{border-top:0}
.seg-row .nm{flex:1;min-width:0;display:flex;align-items:center;gap:.6rem;font-weight:500}
.seg-row .ic{width:34px;height:34px;border-radius:4px 12px 12px 12px;background:var(--sec-soft);color:var(--sec);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.seg-row .ic [data-lucide]{width:18px;height:18px}
.seg-row .n{font-size:20px;font-weight:700;font-variant-numeric:tabular-nums}
.seg-row .pc{font-size:13px;color:var(--text-muted);min-width:42px;text-align:right}

/* Pendientes de aprobar */
.pend{position:relative;background:var(--bg-primary);border:1px solid var(--border);border-radius:4px 20px 20px 20px;padding:1.4rem 1.5rem 1.4rem 1.75rem;overflow:hidden;display:flex;gap:1.1rem;align-items:center;flex-wrap:wrap}
.pend::before{content:"";position:absolute;left:0;top:0;bottom:0;width:6px;background:var(--warning)}
.pend.ok::before{background:var(--success)}
.pend .big{font-size:52px;font-weight:700;line-height:1;color:var(--warning);font-variant-numeric:tabular-nums}
.pend.ok .big{color:var(--success)}
.pend .txt{flex:1 1 220px}
.pend .txt p{color:var(--text-secondary);font-size:14px;margin-top:.2rem}

/* Listas */
.list{display:flex;flex-direction:column}
.row{display:flex;align-items:center;gap:.85rem;padding:.8rem 0;border-top:1px solid var(--border-soft)}
.row:first-child{border-top:0;padding-top:0}
.avatar{width:42px;height:42px;border-radius:4px 14px 14px 14px;background:var(--accent-soft);color:var(--accent);font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:15px}
.row .info{flex:1;min-width:0}
.row .info strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}
.row .info small{color:var(--text-muted);font-size:13px}

/* Accesos rápidos */
.quick{display:flex;flex-wrap:wrap;gap:.75rem}
.quick a{flex:1 1 150px;display:flex;align-items:center;gap:.7rem;padding:.9rem 1rem;border:1px solid var(--border);border-radius:4px 16px 16px 16px;background:var(--bg-primary);color:var(--text-primary);text-decoration:none;font-weight:500;min-height:56px}
.quick a [data-lucide]{color:var(--accent)}

/* Encabezado de dashboard */
.greet{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:.75rem 1.5rem;margin-bottom:1.5rem}
.greet h1{font-size:clamp(24px,3.4vw,30px)}
.greet .fecha{text-transform:capitalize}

/* Paciente: espacio cálido */
.pac-hero{position:relative;border-radius:4px 28px 28px 28px;padding:1.6rem 1.6rem 1.6rem 2rem;margin-bottom:1.25rem;overflow:hidden;
  background:linear-gradient(135deg,var(--sec-soft,var(--accent-soft)),var(--bg-primary) 70%);border:1px solid var(--border)}
.pac-hero::before{content:"";position:absolute;left:0;top:0;bottom:0;width:6px;background:var(--sec,var(--accent))}
.pac-hero h1{margin:.5rem 0 .25rem}
.pac-hero p{color:var(--text-secondary)}
.rut-card{display:flex;gap:1rem;align-items:center;padding:1rem 1.1rem;border:1px solid var(--border);border-radius:4px 16px 16px 16px;background:var(--bg-primary);margin-bottom:.75rem;flex-wrap:wrap}
.rut-card .ic{width:44px;height:44px;border-radius:4px 14px 14px 14px;background:var(--sec-soft,var(--accent-soft));color:var(--sec,var(--accent));display:flex;align-items:center;justify-content:center;flex-shrink:0}
.rut-card .info{flex:1 1 180px;min-width:0}
.rut-card .info small{color:var(--text-muted);font-size:13px}
.dots{display:flex;gap:.45rem;margin:.6rem 0}
.dots i{width:100%;max-width:34px;height:10px;border-radius:5px;background:var(--bg-tertiary);display:block;flex:1}
.dots i.on{background:var(--accent)}
.stat-big{font-size:44px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}

/* Cursos */
.cursos{display:flex;flex-wrap:wrap;gap:1rem}
.curso{flex:1 1 260px;max-width:100%;background:var(--bg-primary);border:1px solid var(--border);border-radius:4px 20px 20px 20px;overflow:hidden;display:flex;flex-direction:column}
.curso .cband{height:8px;background:linear-gradient(90deg,var(--brand-petrol),var(--accent-bright))}
.curso .body{padding:1.1rem 1.25rem 1.25rem;display:flex;flex-direction:column;gap:.5rem;flex:1}
.curso p{color:var(--text-secondary);font-size:14px}
.curso .foot{display:flex;justify-content:space-between;align-items:center;gap:.5rem;margin-top:auto;padding-top:.75rem;flex-wrap:wrap}

/* Home */
.home-wrap{max-width:1240px;margin:0 auto;padding:1.25rem 1.5rem 0}
.hero{position:relative;min-height:600px;border-radius:4px 40px 40px 40px;overflow:hidden;background:var(--brand-navy-fixed,#022541);display:flex;align-items:center;color:#fff}
.hero-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center}
.hero::after{content:"";position:absolute;inset:0;background:linear-gradient(100deg,#022541 0%,rgba(2,37,65,.94) 34%,rgba(2,37,65,.55) 62%,rgba(2,37,65,.12) 100%)}
.hero-deco{position:absolute;right:-60px;bottom:-60px;width:360px;opacity:.07;z-index:0}
.hero-copy{position:relative;z-index:1;padding:3.5rem 3rem;max-width:640px}
.hero-copy .kicker{display:inline-flex;gap:.45rem;align-items:center;padding:.3rem .8rem;border-radius:4px 12px 12px 12px;background:rgba(36,201,203,.16);color:#7FE3E4;font-size:13px;font-weight:600}
.hero-copy h1{font-size:clamp(28px,4.4vw,46px);margin:1.1rem 0 .9rem;color:#fff;letter-spacing:-.01em}
.hero-copy .mat{color:#B3C1CE;font-size:14px;margin-bottom:1.75rem;display:flex;align-items:center;gap:.5rem}
.hero-copy .mat [data-lucide]{width:16px;height:16px;color:#24C9CB}
.hero-cta{display:flex;gap:.75rem;flex-wrap:wrap}
.hero-cta .btn{min-width:170px}
.band{max-width:1240px;margin:0 auto;padding:4rem 1.5rem 0}
.band-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-end;gap:1rem;margin-bottom:1.75rem}
.band-head h2{font-size:clamp(22px,3vw,30px);max-width:560px}
.secciones{display:flex;flex-wrap:wrap;gap:1.25rem;align-items:flex-start}
.seccion{flex:1 1 280px;background:var(--bg-primary);border:1px solid var(--border);border-radius:4px 28px 28px 28px;overflow:hidden;position:relative}
.seccion:nth-child(2){margin-top:2rem}
.seccion:nth-child(3){margin-top:.75rem}
.seccion .pic{position:relative;aspect-ratio:4/3;background:linear-gradient(135deg,var(--sec),#022541);overflow:hidden}
.seccion .pic img{width:100%;height:100%;object-fit:cover;display:block}
.seccion .pic .ic-big{position:absolute;right:14px;bottom:14px;width:46px;height:46px;border-radius:4px 14px 14px 14px;background:rgba(255,255,255,.92);color:#022541;display:flex;align-items:center;justify-content:center}
.seccion .body{padding:1.1rem 1.35rem 1.4rem;border-top:5px solid var(--sec)}
.seccion .num{font-size:12px;font-weight:700;color:var(--sec);letter-spacing:.1em}
.seccion h3{margin:.3rem 0 .4rem}
.seccion p{color:var(--text-secondary);font-size:14px}
.steps{display:flex;flex-wrap:wrap;border-top:1px solid var(--border);}
.step{flex:1 1 260px;padding:1.5rem 1.5rem 1.5rem 0;position:relative}
.step + .step{padding-left:1.5rem;border-left:1px solid var(--border)}
.step .n{font-size:56px;font-weight:700;line-height:1;color:var(--accent);opacity:.9;letter-spacing:-.03em}
.step h3{margin:.6rem 0 .35rem;font-size:17px}
.step p{color:var(--text-secondary);font-size:14px}
.foot-inst{margin-top:4rem;background:#022541;color:#C9D8E2;padding:2.5rem 1.5rem calc(2rem + env(safe-area-inset-bottom))}
.foot-inner{max-width:1240px;margin:0 auto;display:flex;flex-wrap:wrap;gap:1.5rem 3rem;justify-content:space-between;align-items:flex-start}
.foot-inner strong{color:#fff;font-size:16px;display:block}
.foot-inner small{display:block;color:#9FB2C0;font-size:13px;margin-top:.2rem}
.foot-inner .links{display:flex;gap:.75rem;flex-wrap:wrap}
.foot-copy{max-width:1240px;margin:1.5rem auto 0;padding-top:1rem;border-top:1px solid rgba(255,255,255,.12);font-size:13px;color:#9FB2C0}

/* Auth split */
.auth{min-height:calc(100vh - 66px);display:flex;align-items:stretch;justify-content:center}
.auth-split{display:flex;width:100%;max-width:1240px;margin:0 auto;padding:1.5rem}
.auth-brand{position:relative;flex:1 1 46%;border-radius:4px 36px 36px 36px;overflow:hidden;background:#022541;color:#fff;display:flex;flex-direction:column;justify-content:flex-end;padding:2.25rem;min-height:560px}
.auth-brand img.bg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.auth-brand::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(2,37,65,.35) 0%,rgba(2,37,65,.92) 70%,#022541 100%)}
.auth-brand>*:not(.bg){position:relative;z-index:1}
.auth-brand .logo-card{background:#fff;border-radius:4px 16px 16px 16px;padding:.5rem .9rem;display:inline-block;align-self:flex-start;margin-bottom:auto}
.auth-brand .logo-card img{height:42px;width:auto;display:block}
.auth-brand h2{color:#fff;font-size:26px;margin-bottom:.6rem}
.auth-brand p{color:#C9D8E2;font-size:14px}
.auth-brand ul{list-style:none;margin:1.25rem 0 0;padding:0;display:flex;flex-direction:column;gap:.55rem}
.auth-brand li{display:flex;align-items:center;gap:.6rem;font-size:14px;color:#E4EEF4}
.auth-brand li [data-lucide]{color:#24C9CB;width:18px;height:18px}
.auth-form-side{flex:1 1 54%;display:flex;align-items:center;justify-content:center;padding:1rem 1rem 1rem 2rem}
.auth-card{width:100%;max-width:440px}
.auth-card h2{margin-bottom:.25rem;font-size:26px}
.auth-card .sub{color:var(--text-secondary);margin:0 0 1.5rem;font-size:14px}
.auth-mobile-logo{display:none}
.roles{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1.25rem}
.rol-chip{flex:1 1 calc(50% - .5rem);display:flex;align-items:center;gap:.5rem;min-height:46px;padding:.55rem .8rem;border-radius:4px 12px 12px 12px;
  border:1px solid var(--border);background:var(--bg-primary);color:var(--text-secondary);font-weight:500;font-size:14px}
.rol-chip[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft);color:var(--text-primary);box-shadow:inset 3px 0 0 var(--accent)}
.auth-links{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-top:1.1rem;font-size:14px}
.auth-links a{text-decoration:none;font-weight:500;min-height:44px;display:inline-flex;align-items:center}

/* App shell */
.sidebar,.shell-head,.app-footer-nav{display:none}
body.has-shell .sidebar{display:flex}
body.has-shell .shell-head{display:flex}
.sidebar{position:fixed;left:0;top:0;bottom:0;width:250px;background:var(--side-bg);color:var(--side-text);flex-direction:column;padding:1.1rem .85rem;z-index:60;overflow-y:auto}
.sidebar .sb-brand{display:flex;align-items:center;gap:.65rem;padding:.25rem .5rem 1.1rem;text-decoration:none;color:#fff;border-bottom:1px solid rgba(255,255,255,.1);margin-bottom:.9rem}
.sidebar .sb-brand img{width:38px;height:38px;border-radius:8px;background:#fff;padding:2px}
.sidebar .sb-brand strong{display:block;letter-spacing:.08em;text-transform:uppercase;font-size:16px;line-height:1.2}
.sidebar .sb-brand small{display:block;color:#9FB2C0;font-size:12px;line-height:1.2}
.nav-list{display:flex;flex-direction:column;gap:.2rem;flex:1}
.nav-item{display:flex;align-items:center;gap:.75rem;min-height:46px;padding:.55rem .85rem;border-radius:4px 12px 12px 12px;color:var(--side-text);text-decoration:none;font-weight:500;font-size:14.5px;border:0;background:none;width:100%;text-align:left;position:relative}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}
.nav-item.active{background:rgba(255,255,255,.1);color:var(--side-active);box-shadow:inset 4px 0 0 var(--accent-bright)}
.sb-foot{margin-top:1rem;padding-top:1rem;border-top:1px solid rgba(255,255,255,.1);display:flex;flex-direction:column;gap:.5rem}
.sb-foot .btn-install{background:rgba(36,201,203,.14);color:#7FE3E4;border:1px solid rgba(36,201,203,.35);width:100%}
.shell-head{position:fixed;top:0;left:250px;right:0;height:64px;padding:0 1.5rem;padding-top:env(safe-area-inset-top);box-sizing:content-box;background:var(--bg-primary);border-bottom:1px solid var(--border);align-items:center;justify-content:space-between;gap:1rem;z-index:55}
.shell-head .sh-title{display:flex;flex-direction:column;line-height:1.2;min-width:0}
.shell-head .sh-title strong{font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.shell-head .sh-mobile-brand{display:none}
.sh-actions{display:flex;align-items:center;gap:.5rem}
.badge{position:absolute;top:-5px;right:-5px;min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:var(--danger);color:#fff;font-size:12px;font-weight:700;line-height:20px;text-align:center;border:2px solid var(--bg-primary)}
.user-chip{display:flex;align-items:center;gap:.6rem;padding:.2rem .75rem .2rem .25rem;border:1px solid var(--border);border-radius:4px 14px 14px 14px;min-height:44px;max-width:240px}
.user-chip .avatar{width:34px;height:34px;font-size:13px}
.user-chip .u{display:flex;flex-direction:column;line-height:1.2;min-width:0}
.user-chip .u strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-chip .u small{font-size:12px;color:var(--text-muted)}
body.has-shell #app{margin-left:250px;padding-top:calc(64px + env(safe-area-inset-top));min-height:100vh}
.proximo{max-width:560px;margin:2rem auto}

/* Footer nav mobile */
.app-footer-nav a,.app-footer-nav button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:12px;gap:3px;color:var(--text-muted);text-decoration:none;background:none;border:0;min-height:44px;font-weight:500;border-radius:0}
.app-footer-nav a.active{color:var(--accent)}
.app-footer-nav a.active [data-lucide]{stroke-width:2.4}

/* Modal */
.modal-wrapper{position:fixed;inset:0;background:rgba(2,18,30,.6);display:flex;align-items:center;justify-content:center;z-index:1000;padding:1rem;animation:fadeIn .2s}
@keyframes fadeIn{from{opacity:0}}
.modal{background:var(--bg-primary);border-radius:4px 20px 20px 20px;width:100%;max-width:560px;max-height:90vh;display:flex;flex-direction:column;box-shadow:0 24px 70px var(--shadow-strong);overflow:hidden;animation:pop .22s cubic-bezier(.4,0,.2,1)}
@keyframes pop{from{transform:translateY(14px) scale(.98);opacity:0}}
.modal-head{padding:1.1rem 1.5rem;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;gap:1rem}
.modal-body{flex:1;overflow-y:auto;padding:1.5rem;-webkit-overflow-scrolling:touch}
.modal-footer{padding:1rem 1.5rem;border-top:1px solid var(--border);display:flex;gap:.75rem;justify-content:flex-end;background:var(--bg-primary);padding-bottom:calc(1rem + env(safe-area-inset-bottom))}
.menu-grid{display:flex;flex-wrap:wrap;gap:.65rem}
.menu-grid a,.menu-grid button{flex:1 1 calc(33.333% - .65rem);min-width:92px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.4rem;padding:.9rem .4rem;min-height:84px;border:1px solid var(--border);border-radius:4px 14px 14px 14px;background:var(--bg-secondary);color:var(--text-primary);text-decoration:none;font-size:13px;font-weight:500;text-align:center;line-height:1.2}
.menu-grid [data-lucide]{color:var(--accent);width:24px;height:24px}
.menu-grid .active{border-color:var(--accent);background:var(--accent-soft)}
.menu-grid .danger [data-lucide]{color:var(--danger)}
.steps-ios{display:flex;flex-direction:column;gap:.9rem;text-align:left;font-size:15px}
.steps-ios div{display:flex;align-items:center;gap:.75rem}
.steps-ios .ic{width:40px;height:40px;border-radius:4px 12px 12px 12px;background:var(--accent-soft);color:var(--accent);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.modal-center{text-align:center}
.modal-center img.logo{height:54px;margin-bottom:.75rem;background:#fff;border-radius:10px;padding:2px}

/* Perfil */
.perfil-grid{display:flex;flex-wrap:wrap;gap:1.25rem;align-items:flex-start}
.perfil-grid>.panel-card{flex:1 1 340px;min-width:0}
.dl{display:flex;flex-direction:column}
.dl div{display:flex;justify-content:space-between;gap:1rem;padding:.7rem 0;border-top:1px solid var(--border-soft)}
.dl div:first-child{border-top:0}
.dl dt,.dl span.k{color:var(--text-muted);font-size:13px}
.dl span.v{font-weight:500;text-align:right;word-break:break-word}

/* Pull to refresh */
.ptr{position:fixed;top:-56px;left:50%;margin-left:-20px;z-index:900;background:var(--accent);color:var(--accent-text);border-radius:50%;width:40px;height:40px;display:flex;align-items:center;justify-content:center;transition:top .2s;box-shadow:0 6px 18px var(--shadow-strong)}
.ptr.spin [data-lucide]{animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* Tour */
.tour-spot{position:fixed;z-index:10001;border-radius:12px;box-shadow:0 0 0 9999px rgba(2,18,30,.72),0 0 0 3px var(--accent-bright);pointer-events:none;transition:all .25s}
.tour-block{position:fixed;inset:0;z-index:10000}
.tour-tip{position:fixed;z-index:10002;background:var(--bg-primary);color:var(--text-primary);padding:1rem 1.25rem;border-radius:4px 16px 16px 16px;width:min(300px,calc(100vw - 24px));box-shadow:0 12px 40px var(--shadow-strong);border:1px solid var(--border)}
.tour-tip h4{margin-bottom:.3rem}
.tour-tip p{font-size:14px;color:var(--text-secondary);margin-bottom:.9rem}
.tour-tip .tf{display:flex;justify-content:space-between;align-items:center;gap:.5rem}
.tour-tip .tf span{font-size:12px;color:var(--text-muted)}

/* Splash */
#splash{position:fixed;inset:0;z-index:20000;background:#022541;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:1.5rem;padding:1.5rem;transition:opacity .45s;color:#fff;text-align:center;padding-top:calc(1.5rem + env(safe-area-inset-top));padding-bottom:calc(1.5rem + env(safe-area-inset-bottom))}
#splash.out{opacity:0;pointer-events:none}
html.splash-skip #splash{display:none}
.splash-card{background:#fff;border-radius:4px 28px 28px 28px;padding:1.25rem;width:min(320px,80vw);overflow:hidden;box-shadow:0 24px 60px rgba(0,0,0,.35)}
.splash-card img{width:100%;display:block}
#splash h1{color:#fff;font-size:26px;letter-spacing:.1em;text-transform:uppercase}
#splash p{color:#B3C1CE;font-size:14px;max-width:340px;min-height:22px}
.splash-bar{width:min(240px,70vw);height:4px;background:rgba(255,255,255,.18);border-radius:2px;overflow:hidden}
.splash-bar i{display:block;height:100%;width:0;background:#24C9CB;transition:width 8s linear}

/* Toast */
#toast-zone{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:30000;display:flex;flex-direction:column;gap:.5rem;pointer-events:none;width:min(92vw,440px)}
body.has-shell #toast-zone{bottom:calc(84px + env(safe-area-inset-bottom))}
.toast{padding:.8rem 1.1rem;border-radius:4px 12px 12px 12px;font-size:14px;color:#fff;box-shadow:0 10px 30px rgba(0,0,0,.2);animation:slideIn .2s}
.toast-error{background:var(--danger)} .toast-success{background:var(--success)} .toast-warning{background:var(--warning)}
[data-theme="dark"] .toast-success,[data-theme="dark"] .toast-error,[data-theme="dark"] .toast-warning{color:#08131B}

body.modo-app{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}

/* Tablet */
@media (max-width:1024px){
  .sidebar{width:220px}
  .shell-head{left:220px}
  body.has-shell #app{margin-left:220px}
  .hero-copy{padding:3rem 2rem}
}
/* Mobile */
@media (max-width:768px){
  .wrap{padding:1.25rem 1rem}
  .topbar{padding-left:1rem;padding-right:1rem}
  .brand-txt small{display:none}
  .home-wrap{padding:.75rem 1rem 0}
  .hero{min-height:560px;align-items:flex-end;border-radius:4px 28px 28px 28px}
  .hero::after{background:linear-gradient(180deg,rgba(2,37,65,.2) 0%,rgba(2,37,65,.78) 42%,#022541 82%)}
  .hero-copy{padding:2rem 1.25rem 1.5rem}
  .hero-cta .btn{flex:1 1 100%}
  .band{padding:3rem 1rem 0}
  .seccion:nth-child(2),.seccion:nth-child(3){margin-top:0}
  .step,.step + .step{flex:1 1 100%;padding:1.25rem 0;border-left:0;border-bottom:1px solid var(--border)}
  .auth{min-height:calc(100vh - 66px)}
  .auth-split{padding:1rem}
  .auth-brand{display:none}
  .auth-form-side{padding:.5rem 0}
  .auth-mobile-logo{display:flex;justify-content:center;margin-bottom:1.25rem}
  .auth-mobile-logo img{height:48px;background:#fff;border-radius:10px;padding:2px}
  /* shell */
  body.has-shell .sidebar{display:none}
  .shell-head{left:0;padding:0 1rem}
  .shell-head .sh-mobile-brand{display:block;width:34px;height:34px;border-radius:8px;background:#fff;padding:2px;flex-shrink:0}
  .shell-head .sh-left{display:flex;align-items:center;gap:.65rem;min-width:0}
  .user-chip,.sh-logout{display:none}
  body.has-shell #app{margin-left:0;padding-bottom:calc(72px + env(safe-area-inset-bottom))}
  body.has-shell .app-footer-nav{display:flex;position:fixed;bottom:0;left:0;right:0;height:calc(64px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);
    background:var(--bg-primary);border-top:1px solid var(--border);z-index:999}
  .kpi .num{font-size:32px}
  .modal-wrapper{align-items:flex-end;padding:0}
  .modal{max-width:100%;border-radius:20px 20px 0 0}
  .menu-grid a,.menu-grid button{flex:1 1 calc(33.333% - .65rem)}
}
@media (max-width:380px){
  .kpi{flex:1 1 100%}
  .menu-grid a,.menu-grid button{flex:1 1 calc(50% - .65rem)}
}
.menu-grid .js-install:not(.visible),.sb-foot .js-install:not(.visible){display:none}
