/* Extraído de <style> */
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent;}
:root{
  --red:#e8000a;--red2:#b5000a;--black:#000;--gray:#111;--gray2:#181818;--gray3:#242424;--gray4:#333;
  --text:#fff;--text2:#aaa;--text3:#555;--border:#222;
  --radius:16px;--radius-sm:10px;--font:'Outfit',sans-serif;--display:'Bebas Neue',sans-serif;
}
html,body{background:var(--black);color:var(--text);font-family:var(--font);min-height:100%;overflow-x:hidden;scroll-behavior:smooth;}

/* FONDO */
#bg-canvas{position:fixed;inset:0;z-index:0;pointer-events:none;}
.grain-overlay{position:fixed;inset:0;pointer-events:none;z-index:1;opacity:.4;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");}

/* NAV */
.nav{position:fixed;top:0;left:0;right:0;z-index:300;height:64px;background:rgba(0,0,0,.92);backdrop-filter:blur(20px);border-bottom:1px solid rgba(255,255,255,.05);display:flex;align-items:center;justify-content:space-between;padding:0 20px;}
.nav-logo{display:flex;align-items:center;gap:10px;cursor:pointer;user-select:none;text-decoration:none;}
.logo-mark{width:40px;height:40px;border-radius:50%;overflow:hidden;border:1.5px solid rgba(255,255,255,.15);flex-shrink:0;background:#111;display:flex;align-items:center;justify-content:center;}
.logo-mark img{width:100%;height:100%;object-fit:cover;border-radius:50%;}
.logo-txt{font-family:var(--display);font-size:30px;letter-spacing:1px;line-height:1;color:#fff;}
.logo-txt em{color:var(--red);font-style:normal;}
.logo-sub{font-size:9px;color:var(--text3);letter-spacing:.18em;text-transform:uppercase;}
#notif-dot{display:none;width:9px;height:9px;background:var(--red);border-radius:50%;margin-left:4px;animation:blink 1.2s infinite;}
.nav-links{display:flex;align-items:center;gap:2px;}
.nav-link{color:var(--text3);text-decoration:none;font-size:12px;font-weight:600;padding:7px 13px;border-radius:20px;transition:all .2s;letter-spacing:.04em;white-space:nowrap;}
.nav-link:hover{color:#fff;background:rgba(255,255,255,.07);}
.nav-link.nav-cta{background:var(--red);color:#fff;font-weight:800;margin-left:4px;}
.nav-link.nav-cta:hover{background:var(--red2);}
/* Instagram dropdown */
.ig-drop{position:relative;display:inline-flex;}
.ig-drop-btn{color:var(--text3);text-decoration:none;font-size:12px;font-weight:600;padding:7px 13px;border-radius:20px;transition:all .2s;letter-spacing:.04em;white-space:nowrap;background:none;border:none;font-family:var(--font);cursor:pointer;display:flex;align-items:center;gap:5px;}
.ig-drop-btn:hover{color:#fff;background:rgba(255,255,255,.07);}
.ig-drop-btn .arr{font-size:8px;opacity:.5;transition:transform .2s;}
.ig-drop.open .ig-drop-btn .arr{transform:rotate(180deg);}
.ig-drop-menu{display:none;position:absolute;top:calc(100% + 6px);right:0;background:#111;border:1px solid var(--border);border-radius:var(--radius-sm);min-width:190px;z-index:400;overflow:hidden;box-shadow:0 12px 40px rgba(0,0,0,.6);}
.ig-drop.open .ig-drop-menu{display:block;}
.ig-drop-item{display:flex;align-items:center;gap:10px;padding:12px 16px;color:var(--text2);text-decoration:none;font-size:13px;font-weight:600;border-bottom:1px solid rgba(255,255,255,.05);transition:all .2s;}
.ig-drop-item:last-child{border-bottom:none;}
.ig-drop-item:hover{background:rgba(225,48,108,.1);color:#e1306c;}
.ig-drop-item .ig-handle{font-size:11px;color:var(--text3);margin-top:1px;}
/* Hamburger mobile */
.nav-ham{display:none;flex-direction:column;gap:5px;cursor:pointer;padding:8px;background:none;border:none;}
.nav-ham span{display:block;width:22px;height:2px;background:#fff;border-radius:2px;transition:all .25s;}
.mob-menu{display:none;position:fixed;top:64px;left:0;right:0;background:rgba(0,0,0,.97);border-bottom:1px solid var(--border);z-index:299;padding:12px 0;}
.mob-menu.open{display:block;}
.mob-link{display:block;padding:13px 24px;color:var(--text2);text-decoration:none;font-size:14px;font-weight:600;border-bottom:1px solid rgba(255,255,255,.04);transition:color .2s;}
.mob-link:hover{color:#fff;background:rgba(255,255,255,.04);}
@media(max-width:860px){.nav-links .nav-link:not(.nav-cta){display:none;}.nav-ham{display:flex;}}
@media(max-width:480px){.nav-links .nav-cta{display:none;}.nav-ham{display:flex;}}
@keyframes blink{0%,100%{opacity:1}50%{opacity:.2}}

/* HERO */
.hero{min-height:100vh;padding-top:64px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;position:relative;overflow:hidden;z-index:2;}
.hero-glow{position:absolute;width:600px;height:600px;background:radial-gradient(ellipse,rgba(232,0,10,.18) 0%,transparent 70%);top:50%;left:50%;transform:translate(-50%,-50%);pointer-events:none;}
.hero-grid{position:absolute;inset:0;background-image:linear-gradient(rgba(255,255,255,.03) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.03) 1px,transparent 1px);background-size:60px 60px;pointer-events:none;}
.hero-content{position:relative;z-index:2;padding:20px;max-width:700px;}
.hero-tag{display:inline-flex;align-items:center;gap:6px;background:rgba(232,0,10,.1);border:1px solid rgba(232,0,10,.25);color:var(--red);font-size:11px;font-weight:700;letter-spacing:.15em;text-transform:uppercase;padding:6px 16px;border-radius:20px;margin-bottom:24px;opacity:0;animation:up .6s .2s forwards;}
.hero-h1{font-family:var(--display);font-size:clamp(80px,18vw,160px);line-height:.88;letter-spacing:4px;margin-bottom:10px;opacity:0;animation:heroIn .9s .2s cubic-bezier(.16,1,.3,1) forwards, tomaunoPulse 3.2s 1.15s ease-out 1;position:relative;text-shadow:0 0 0 rgba(232,0,10,0);}
.hero-h1 em{color:var(--red);font-style:normal;}
.hero-h1::after{content:'TOMAUNO';position:absolute;inset:0;color:transparent;-webkit-text-stroke:1.2px rgba(232,0,10,.0);text-shadow:0 0 0 rgba(232,0,10,0);pointer-events:none;animation:tomaunoTrace 3.2s 1.15s ease-out 1;}
.hero-live-line{font-size:11px;color:var(--text3);font-weight:800;letter-spacing:.08em;margin:22px 0 2px;white-space:nowrap;opacity:0;animation:up .7s .68s forwards;}
.hero-p{font-size:clamp(14px,2vw,17px);color:var(--text2);max-width:380px;margin:0 auto 36px;line-height:1.65;opacity:0;animation:up .7s .5s forwards;}
.hero-tagline{font-size:clamp(11px,1.4vw,13px);letter-spacing:.35em;text-transform:uppercase;color:rgba(255,255,255,.28);font-weight:700;margin-bottom:12px;opacity:0;animation:up .6s .45s forwards;}
.hero-stats{display:flex;align-items:center;justify-content:center;gap:0;margin-top:36px;opacity:0;animation:up .7s .8s forwards;}
.hero-stat{text-align:center;padding:0 32px;}
.hero-stat-n{font-family:var(--display);font-size:52px;letter-spacing:2px;color:var(--red);line-height:1;}
.hero-stat-l{font-size:11px;color:var(--text3);text-transform:uppercase;letter-spacing:.15em;margin-top:4px;font-weight:700;}
.hero-stat-sep{width:1px;height:40px;background:rgba(255,255,255,.1);}
.hero-scroll{position:absolute;bottom:28px;left:50%;transform:translateX(-50%);font-size:10px;letter-spacing:.2em;text-transform:uppercase;color:var(--text3);display:flex;flex-direction:column;align-items:center;gap:6px;animation:bounce 2.5s infinite;}
@media(max-width:480px){.hero-stat{padding:0 16px;}.hero-stat-n{font-size:36px;}}
@keyframes bounce{0%,100%{transform:translateX(-50%) translateY(0)}50%{transform:translateX(-50%) translateY(7px)}}
@keyframes up{from{opacity:0;transform:translateY(28px)}to{opacity:1;transform:translateY(0)}}
@keyframes heroIn{from{opacity:0;transform:scale(.85);filter:blur(12px)}to{opacity:1;transform:scale(1);filter:blur(0)}}
@keyframes tomaunoPulse{0%{text-shadow:0 0 0 rgba(232,0,10,0)}18%{text-shadow:0 0 18px rgba(232,0,10,.7),0 0 42px rgba(232,0,10,.35)}55%{text-shadow:0 0 10px rgba(232,0,10,.45),0 0 28px rgba(232,0,10,.2)}100%{text-shadow:0 0 0 rgba(232,0,10,0)}}
@keyframes tomaunoTrace{0%{-webkit-text-stroke-color:rgba(232,0,10,0);filter:drop-shadow(0 0 0 rgba(232,0,10,0));transform:scale(.992)}20%{-webkit-text-stroke-color:rgba(232,0,10,.75);filter:drop-shadow(0 0 18px rgba(232,0,10,.65));transform:scale(1.012)}58%{-webkit-text-stroke-color:rgba(232,0,10,.35);filter:drop-shadow(0 0 10px rgba(232,0,10,.28));transform:scale(1.004)}100%{-webkit-text-stroke-color:rgba(232,0,10,0);filter:drop-shadow(0 0 0 rgba(232,0,10,0));transform:scale(1)}}

/* SECCIONES GENERALES */
.section-wrap{max-width:1140px;margin:0 auto;padding:0 20px;}
section{position:relative;z-index:2;}
.sec-head{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:36px;gap:16px;}
.sec-title{font-family:var(--display);font-size:clamp(40px,7vw,64px);letter-spacing:2px;line-height:1;}
.sec-sub{font-size:13px;color:var(--text3);}

/* BUSQUEDA */
.search-wrap{position:relative;margin-bottom:20px;}
.search-input{width:100%;background:var(--gray2);border:1.5px solid var(--border);color:var(--text);padding:12px 16px 12px 44px;border-radius:50px;font-family:var(--font);font-size:14px;outline:none;transition:border-color .25s,box-shadow .25s;}
.search-input:focus{border-color:var(--red);box-shadow:0 0 0 3px rgba(232,0,10,.1);}
.search-input::placeholder{color:var(--text3);}
.search-icon{position:absolute;left:16px;top:50%;transform:translateY(-50%);width:18px;height:18px;stroke:var(--text3);fill:none;pointer-events:none;}
.search-clear{position:absolute;right:14px;top:50%;transform:translateY(-50%);background:none;border:none;color:var(--text3);cursor:pointer;font-size:15px;padding:4px 6px;transition:color .2s;display:none;line-height:1;}
.search-clear:hover{color:#fff;}
.search-info{font-size:12px;color:var(--text3);margin-bottom:16px;min-height:1.2em;}

/* CURSOS GRID */
#sec-cursos{padding:80px 20px 60px;}
.cursos-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:20px;overflow:visible;}

/* CARD */
.ccard{background:var(--gray2);border:1px solid var(--border);border-radius:var(--radius);overflow:visible;cursor:pointer;will-change:transform;transform:translateY(0) scale(1);transition:transform .4s cubic-bezier(.25,.8,.25,1),border-color .3s,box-shadow .3s;position:relative;isolation:isolate;}
.ccard:hover{transform:translateY(-8px) scale(1.03) !important;border-color:rgba(232,0,10,.7) !important;box-shadow:0 30px 70px rgba(0,0,0,.7),0 0 0 1px rgba(232,0,10,.25),0 0 80px rgba(232,0,10,.12) !important;z-index:10;}
.ccard::after{content:'';position:absolute;inset:0;border-radius:var(--radius);background:radial-gradient(ellipse at 50% 0%,rgba(232,0,10,.1),transparent 70%);opacity:0;transition:opacity .4s;pointer-events:none;}
.ccard:hover::after{opacity:1;}
.ccard.fin{opacity:.35;pointer-events:none;filter:grayscale(1);}
.ccard.fin::before{content:'FINALIZADO';position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-family:var(--display);font-size:36px;letter-spacing:4px;color:rgba(255,255,255,.5);background:rgba(0,0,0,.6);z-index:3;pointer-events:none;}
.cimg{position:relative;overflow:hidden;background:#0a0a0a;width:100%;padding-bottom:133%;}
.cimg img{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;object-fit:contain;object-position:center;background:#0a0a0a;transition:opacity .3s;}
.ccard:hover .cimg img{opacity:.9;}
.cimg-placeholder{position:absolute;inset:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:linear-gradient(135deg,#0a0a0a 0%,#150505 100%);}
.cimg-placeholder .icon{font-size:44px;opacity:.2;}
.cimg-placeholder .brand{font-family:var(--display);font-size:32px;letter-spacing:3px;opacity:.15;}
.cimg-placeholder .brand em{color:var(--red);font-style:normal;}
/* Badge estado (izq) */
.cbadge{position:absolute;top:12px;left:12px;font-size:10px;font-weight:800;padding:5px 12px;border-radius:20px;text-transform:uppercase;letter-spacing:.07em;z-index:2;}
.cbadge.open{background:var(--red);color:#fff;border:1px solid var(--red2);}
.cbadge.full{background:rgba(232,0,10,.12);color:#ff4444;border:1px solid rgba(232,0,10,.25);}
.cbadge.end{background:rgba(80,80,80,.2);color:#555;border:1px solid rgba(80,80,80,.2);}
.cbadge.ses{background:rgba(90,60,220,.12);color:#a78bfa;border:1px solid rgba(90,60,220,.2);}
/* Badge cupos (der) */
.ccupos-badge{position:absolute;top:12px;right:12px;background:rgba(0,0,0,.75);border:1px solid rgba(255,255,255,.12);color:#fff;padding:4px 9px;border-radius:20px;font-size:10px;font-weight:700;backdrop-filter:blur(8px);z-index:2;}
.cbody{padding:18px 18px 20px;border-radius:0 0 var(--radius) var(--radius);background:var(--gray2);}
.ctitle{font-size:18px;font-weight:800;margin-bottom:6px;line-height:1.3;}
.cdesc{font-size:13px;color:var(--text2);line-height:1.55;margin-bottom:14px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.cmeta{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:16px;}
.chip{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:var(--text2);background:rgba(255,255,255,.04);padding:5px 11px;border-radius:20px;border:1px solid rgba(255,255,255,.07);}
.chip.accent{color:var(--red);background:rgba(232,0,10,.07);border-color:rgba(232,0,10,.18);}
.cfoot{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:nowrap;}
.cprice{font-family:var(--display);font-size:30px;letter-spacing:1px;color:var(--red);}
.cprice.free{color:#00d25a;}
/* Dos botones en el footer de la card */
.cfoot-btns{display:flex;gap:6px;align-items:center;flex-shrink:0;}
.cbtn{padding:9px 14px;background:var(--red);color:#fff;border:none;border-radius:50px;font-size:12px;font-weight:800;font-family:var(--font);cursor:pointer;transition:all .2s;letter-spacing:.02em;white-space:nowrap;}
.cbtn:hover{background:var(--red2);}
.cbtn:disabled{background:var(--gray4);color:var(--text3);cursor:default;}
.cbtn-info{padding:9px 14px;background:rgba(255,255,255,.06);color:var(--text2);border:1px solid rgba(255,255,255,.1);border-radius:50px;font-size:12px;font-weight:700;font-family:var(--font);cursor:pointer;transition:all .2s;white-space:nowrap;}
.cbtn-info:hover{background:rgba(255,255,255,.12);color:#fff;}

/* MODAL */
.moverlay{position:fixed;inset:0;background:rgba(0,0,0,.85);z-index:500;display:flex;align-items:center;justify-content:center;padding:20px;backdrop-filter:blur(10px);}
.mbox{background:var(--gray);border:1px solid var(--border);border-radius:var(--radius);width:100%;max-width:min(980px,calc(100vw - 32px));max-height:90vh;overflow-y:auto;padding:32px 32px 40px;position:relative;animation:minIn .22s cubic-bezier(.4,0,.2,1);overscroll-behavior:contain;}
@keyframes minIn{from{opacity:0;transform:scale(.94) translateY(18px)}to{opacity:1;transform:scale(1) translateY(0)}}
.mclose{position:absolute;top:16px;right:16px;background:var(--gray3);border:none;color:var(--text2);width:32px;height:32px;border-radius:50%;font-size:15px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s;}
.mclose:hover{background:var(--red);color:#fff;}
.mtitle{font-family:var(--display);font-size:34px;letter-spacing:1px;margin-bottom:4px;}
.msub{font-size:13px;color:var(--text3);margin-bottom:20px;line-height:1.5;}
.mlbl{font-size:10px;color:var(--red);text-transform:uppercase;letter-spacing:.14em;font-weight:800;margin:16px 0 8px;}

/* FORMS */
.finput{width:100%;padding:12px 14px;background:#0d0d0d;border:1.5px solid var(--border);border-radius:var(--radius-sm);color:var(--text);font-family:var(--font);font-size:14px;outline:none;margin-bottom:8px;transition:border-color .2s;}
.finput:focus{border-color:var(--red);}
.finput::placeholder{color:var(--text3);}
textarea.finput{resize:vertical;min-height:90px;}
.frow2{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
.fgroup{margin-bottom:8px;}
.flbl{font-size:11px;color:var(--text3);margin-bottom:4px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;display:block;}
.btn-main{width:100%;padding:14px;background:var(--red);color:#fff;border:none;border-radius:50px;font-size:15px;font-weight:800;font-family:var(--font);cursor:pointer;letter-spacing:.04em;transition:all .2s;margin-top:10px;text-align:center;display:flex;align-items:center;justify-content:center;gap:8px;text-decoration:none;}
.btn-main:hover{background:var(--red2);}
.btn-out{width:100%;padding:12px;background:transparent;color:var(--text2);border:1.5px solid var(--border);border-radius:50px;font-size:14px;font-family:var(--font);cursor:pointer;margin-top:8px;transition:all .2s;}
.btn-out:hover{border-color:var(--text2);color:#fff;}
.tutor-box{background:#1a1500;border:1px solid #3a2f00;border-radius:var(--radius-sm);padding:14px;margin-bottom:8px;}

/* SESIONES / SLOTS */
.slots-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:8px;margin-top:12px;}
.slot{padding:10px 6px;border-radius:var(--radius-sm);border:1.5px solid var(--border);text-align:center;cursor:pointer;transition:all .2s;font-size:12px;font-weight:700;}
.slot.libre{border-color:var(--red2);background:rgba(232,0,10,.08);color:#ff6666;}
.slot.libre:hover{background:rgba(232,0,10,.18);transform:scale(1.04);color:#fff;}
.slot.ocupado{border-color:#2a1010;background:rgba(200,0,0,.07);color:#ff5555;cursor:not-allowed;}
.slot-t{font-size:11px;margin-bottom:2px;}
.slot-n{font-size:10px;color:var(--text3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* LINKS */
.ig-link{color:#e1306c;text-decoration:none;font-size:13px;transition:opacity .2s;}
.ig-link:hover{opacity:.7;}
.wp-link{color:#25d366;text-decoration:none;}
.det-links{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px;}
.det-link{display:inline-flex;align-items:center;gap:6px;padding:10px 18px;border-radius:50px;font-size:13px;font-weight:700;text-decoration:none;transition:all .2s;}
.det-link.ig{background:rgba(131,58,180,.12);color:#e1306c;border:1px solid rgba(131,58,180,.2);}
.det-link.ig:hover{background:rgba(131,58,180,.25);}
.det-link.wp{background:rgba(37,211,102,.08);color:#25d366;border:1px solid rgba(37,211,102,.2);}
.det-link.wp:hover{background:rgba(37,211,102,.18);}

/* SERVICIOS */
#sec-servicios{padding:60px 0;}
.srv-card{background:var(--gray2);border:1px solid var(--border);border-radius:var(--radius);padding:32px 24px;text-align:center;cursor:pointer;transition:transform .25s cubic-bezier(.4,0,.2,1),border-color .25s,box-shadow .25s;position:relative;overflow:hidden;}
.srv-card::before{content:'';position:absolute;inset:0;background:radial-gradient(ellipse at 50% 0%,rgba(232,0,10,.12),transparent 70%);opacity:0;transition:opacity .3s;}
.srv-card:hover{transform:translateY(-6px) scale(1.02);border-color:rgba(232,0,10,.5);box-shadow:0 20px 50px rgba(0,0,0,.5),0 0 0 1px rgba(232,0,10,.15),0 0 40px rgba(232,0,10,.08);}
.srv-card:hover::before{opacity:1;}
.srv-icon{font-size:44px;margin-bottom:14px;display:block;transition:transform .3s;}
.srv-card:hover .srv-icon{transform:scale(1.15) rotate(-4deg);}
.srv-title{font-family:var(--display);font-size:22px;letter-spacing:1px;margin-bottom:10px;}
.srv-desc{font-size:13px;color:var(--text2);line-height:1.65;margin-bottom:16px;}
.srv-price{font-family:var(--display);font-size:22px;color:var(--red);margin-bottom:8px;}
.srv-cta{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:700;color:var(--red);opacity:.7;transition:opacity .2s,gap .2s;}
.srv-card:hover .srv-cta{opacity:1;gap:10px;}

/* TESTIMONIOS */
#sec-testimonios{padding:60px 0;border-top:1px solid var(--border);}
.test-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:20px;}
.test-card{background:var(--gray2);border:1px solid var(--border);border-radius:var(--radius);padding:24px 24px 20px;transition:transform .25s cubic-bezier(.4,0,.2,1),border-color .25s,box-shadow .25s;position:relative;overflow:hidden;}
.test-card:hover{transform:translateY(-6px) scale(1.02);border-color:rgba(232,0,10,.5);box-shadow:0 20px 50px rgba(0,0,0,.5);}
.test-card:hover{border-color:rgba(232,0,10,.3);}
.test-stars{color:#f5c842;font-size:16px;margin-bottom:12px;letter-spacing:2px;}
.test-text{font-size:14px;color:var(--text2);line-height:1.7;font-style:italic;margin-bottom:16px;}
.test-author{display:flex;align-items:center;gap:12px;}
.test-avatar{width:40px;height:40px;border-radius:50%;background:var(--gray3);border:1.5px solid rgba(255,255,255,.1);overflow:hidden;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:18px;}
.test-avatar img{width:100%;height:100%;object-fit:cover;}
.test-name{font-size:14px;font-weight:700;margin-bottom:2px;}
.test-ig{font-size:12px;color:#e1306c;text-decoration:none;display:block;margin-bottom:2px;}
.test-ig:hover{opacity:.75;}
.test-course{font-size:11px;color:var(--text3);margin-top:2px;}
.test-date{font-size:10px;color:var(--text3);margin-top:1px;}
.test-stars{color:var(--red);font-size:15px;margin-bottom:12px;letter-spacing:3px;}
.test-text{font-size:13px;color:var(--text2);line-height:1.75;font-style:italic;margin-bottom:16px;}
.test-avatar{width:52px;height:52px;border-radius:50%;background:var(--red);border:2px solid rgba(232,0,10,.3);overflow:hidden;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:20px;font-weight:800;color:#fff;}
.test-avatar img{width:100%;height:100%;object-fit:cover;}
.test-course{font-size:12px;color:var(--text3);}

/* FAQ */
#sec-faq{padding:60px 0;}
.faq-item{border:1px solid var(--border);border-radius:var(--radius-sm);margin-bottom:8px;overflow:hidden;cursor:pointer;transition:border-color .2s;}
.faq-item:hover{border-color:rgba(232,0,10,.3);}
.faq-q{padding:16px 18px;font-size:15px;font-weight:600;display:flex;justify-content:space-between;align-items:center;gap:12px;user-select:none;}
.faq-arrow{font-size:11px;color:var(--text3);transition:transform .25s;flex-shrink:0;}
.faq-a{padding:0 18px;font-size:14px;color:var(--text2);line-height:1.7;max-height:0;overflow:hidden;transition:max-height .3s ease,padding .3s;}
.faq-item.open .faq-a{max-height:200px;padding:0 18px 16px;}
.faq-item.open .faq-arrow{transform:rotate(180deg);}
.faq-item.open{border-color:rgba(232,0,10,.4);background:rgba(232,0,10,.03);}

/* UBICACION */
#sec-ubicacion{padding:60px 0;background:rgba(0,0,0,.45);border-top:1px solid var(--border);border-bottom:1px solid var(--border);}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:24px;align-items:start;}
@media(max-width:700px){.grid-2{grid-template-columns:1fr !important;}}

/* ADMIN */
.admin-wrap{max-width:1260px;margin:0 auto;padding:80px 20px 80px;position:relative;z-index:2;min-height:100vh;overscroll-behavior:contain;}
.admin-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px;}
.admin-title{font-family:var(--display);font-size:42px;letter-spacing:2px;}
.admin-title em{color:var(--red);font-style:normal;}
.admin-dash{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:28px;}
.dash-card{background:var(--gray2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:16px 20px;}
.dash-n{font-family:var(--display);font-size:36px;letter-spacing:1px;color:var(--red);line-height:1;}
.dash-l{font-size:11px;color:var(--text3);text-transform:uppercase;letter-spacing:.1em;margin-top:4px;font-weight:700;}
.atabs{display:flex;gap:0;background:var(--gray2);border-radius:var(--radius);overflow:hidden;width:fit-content;margin-bottom:24px;border:1px solid var(--border);overflow-x:auto;}
.atab{padding:10px 18px;font-size:12px;font-weight:700;cursor:pointer;border:none;background:none;color:var(--text3);font-family:var(--font);transition:all .2s;white-space:nowrap;border-right:1px solid var(--border);display:flex;align-items:center;gap:6px;}
.atab:last-child{border-right:none;}
.atab:hover{color:var(--text2);background:rgba(255,255,255,.03);}
.atab.on{background:var(--red);color:#fff;}
.tab-badge{background:rgba(255,255,255,.2);color:#fff;border-radius:10px;padding:1px 7px;font-size:10px;font-weight:800;}
.atab.on .tab-badge{background:rgba(0,0,0,.25);}
.acard{background:var(--gray2);border:1px solid var(--border);border-radius:var(--radius);padding:22px;margin-bottom:16px;}
.acard-title{font-size:10px;font-weight:800;color:var(--text3);text-transform:uppercase;letter-spacing:.12em;margin-bottom:16px;}
.tbl-wrap{overflow-x:auto;max-width:100%;}
table{width:100%;border-collapse:collapse;font-size:13px;min-width:680px;}
th{text-align:left;padding:10px 12px;font-size:10px;color:var(--text3);text-transform:uppercase;letter-spacing:.08em;border-bottom:1px solid var(--border);font-weight:800;background:#0d0d0d;}
td{padding:10px 12px;border-bottom:1px solid #181818;vertical-align:top;}
tr:hover td{background:rgba(255,255,255,.015);}
.tdn{font-weight:700;font-size:14px;}
.tds{font-size:11px;color:var(--text3);margin-top:2px;}
a.wabtn{display:inline-flex;align-items:center;gap:4px;background:#1a3320;color:#25d366;border:none;border-radius:20px;padding:5px 10px;font-size:11px;font-weight:700;font-family:var(--font);cursor:pointer;text-decoration:none;transition:all .2s;}
a.wabtn:hover{background:#25d366;color:#000;}
.bsm{display:inline-flex;align-items:center;gap:3px;padding:5px 10px;border-radius:20px;font-size:11px;font-weight:700;font-family:var(--font);cursor:pointer;border:none;transition:all .2s;}
.bsm.bl{background:#1a2a3a;color:#5bc4f5;}
.bsm.bl:hover{background:#5bc4f5;color:#000;}
.bsm.gr{background:#1a3a2a;color:#4caf7d;}
.bsm.gr:hover{background:#4caf7d;color:#000;}
.bsm.re{background:#3a1010;color:#ff5555;}
.bsm.re:hover{background:#ff5555;color:#fff;}
.bsm.wa{background:#1a3320;color:#25d366;}
.bsm.wa:hover{background:#25d366;color:#000;}
.ppill{font-size:10px;font-weight:800;padding:3px 9px;border-radius:20px;display:inline-block;}
.pp-ok{background:#1a3a2a;color:#4caf7d;}
.pp-pe{background:#3a1010;color:#e05252;}
.pp-pa{background:#3a2800;color:#f5c842;}
.admin-ci{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--border);}
.admin-ci:last-child{border-bottom:none;}
.admin-ci-info{flex:1;}
.admin-ci-tit{font-size:14px;font-weight:700;}
.admin-ci-sub{font-size:11px;color:var(--text3);margin-top:2px;}

/* TOAST */
#back-top{position:fixed;bottom:24px;right:24px;width:44px;height:44px;background:var(--red);color:#fff;border:none;border-radius:50%;font-size:20px;cursor:pointer;z-index:400;display:none;align-items:center;justify-content:center;box-shadow:0 4px 20px rgba(232,0,10,.4);transition:all .2s;}
#back-top:hover{background:var(--red2);transform:scale(1.1);}
#back-top.show{display:flex;}
#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(20px);background:#fff;color:#000;padding:14px 28px;border-radius:30px;font-size:14px;font-weight:700;z-index:900;opacity:0;transition:all .3s;pointer-events:none;white-space:nowrap;box-shadow:0 4px 30px rgba(0,0,0,.5);cursor:pointer;}
#toast.show{pointer-events:auto;opacity:1;transform:translateX(-50%) translateY(0);}

/* FOOTER */
footer{border-top:1px solid var(--border);padding:48px 20px;text-align:center;position:relative;z-index:2;}
.flogo{font-family:var(--display);font-size:52px;letter-spacing:4px;margin-bottom:8px;}
.flogo em{color:var(--red);font-style:normal;}
.fsub{font-size:12px;color:var(--text3);margin-bottom:22px;}
.fwa{display:inline-flex;align-items:center;gap:8px;background:#1a3320;color:#25d366;padding:13px 28px;border-radius:50px;font-size:14px;font-weight:700;text-decoration:none;transition:all .2s;margin-bottom:18px;}
.fwa:hover{background:#25d366;color:#000;}
.fcred{font-size:11px;color:var(--text3);}
.fcred a{display:inline-flex;align-items:center;gap:5px;color:var(--text3);text-decoration:none;border:1px solid var(--border);padding:5px 13px;border-radius:20px;margin-top:8px;transition:all .2s;}
.fcred a:hover{border-color:#444;color:#fff;}

/* APPS PANEL */
.app-row{display:flex;align-items:center;gap:14px;padding:14px 16px;border-radius:var(--radius-sm);border:1px solid var(--border);margin-bottom:8px;text-decoration:none;background:var(--gray2);transition:border-color .2s,background .2s;}
.app-row:hover{border-color:rgba(232,0,10,.4);background:#1e1414;}
.app-ico{font-size:26px;flex-shrink:0;width:40px;text-align:center;}
.app-info{flex:1;}
.app-name{font-size:14px;font-weight:700;color:#fff;}
.app-url{font-size:11px;color:var(--text3);margin-top:2px;}
.app-arr{color:var(--red);font-size:18px;font-weight:700;}

.main-tab{background:none;border:none;color:var(--text3);font-family:var(--font);font-size:11px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;padding:14px 20px;cursor:pointer;border-bottom:2px solid transparent;transition:all .2s;white-space:nowrap;flex-shrink:0;}
.main-tab:hover{color:var(--text2);}
.main-tab.on{color:#fff;border-bottom-color:var(--red);}
#db-status{display:inline-flex;align-items:center;gap:5px;font-size:10px;color:var(--text3);padding:4px 10px;border-radius:20px;border:1px solid var(--border);background:rgba(0,0,0,.4);margin-left:8px;}
#db-dot{width:7px;height:7px;border-radius:50%;background:#555;flex-shrink:0;transition:background .4s;}
#db-status.connecting #db-dot{background:#f5c842;animation:blink 1s infinite;}
#db-status.online #db-dot{background:#4caf7d;}
#db-status.offline #db-dot{background:#e05252;}
#sec-eventos{padding:60px 0;border-top:1px solid var(--border);}
.ev-hero{background:linear-gradient(135deg,rgba(232,0,10,.08),transparent);border:1px solid rgba(232,0,10,.15);border-radius:var(--radius);padding:36px 32px;text-align:center;margin-bottom:28px;}
.ev-hero-icon{font-size:44px;margin-bottom:12px;}
.ev-hero-title{font-family:var(--display);font-size:clamp(28px,5vw,48px);letter-spacing:2px;margin-bottom:10px;}
.ev-hero-sub{font-size:14px;color:var(--text2);line-height:1.6;margin-bottom:16px;}
.ev-hero-link{color:var(--red);text-decoration:none;font-weight:700;}
.ev-org-bar{background:var(--gray2);border:1px solid var(--border);border-radius:var(--radius);padding:18px 24px;display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:28px;flex-wrap:wrap;}
.ev-org-input{background:#0d0d0d;border:1.5px solid var(--border);color:var(--text);padding:10px 14px;border-radius:50px;font-family:var(--font);font-size:13px;outline:none;width:190px;}
.ev-org-input:focus{border-color:var(--red);}
.ev-org-input::placeholder{color:var(--text3);}
.ev-card{background:var(--gray2);border:1px solid var(--border);border-radius:var(--radius);overflow:visible;cursor:pointer;transition:transform .25s cubic-bezier(.4,0,.2,1),border-color .25s,box-shadow .25s;position:relative;}
.ev-card:hover{transform:translateY(-6px) scale(1.02);border-color:rgba(232,0,10,.5);box-shadow:0 20px 50px rgba(0,0,0,.5);}
.ev-badge-ext{position:absolute;top:10px;left:10px;background:rgba(90,60,220,.15);color:#a78bfa;border:1px solid rgba(90,60,220,.3);font-size:9px;font-weight:800;padding:3px 10px;border-radius:20px;text-transform:uppercase;z-index:2;}
.ev-badge-tomauno{position:absolute;top:10px;right:10px;background:rgba(232,0,10,.1);color:var(--red);border:1px solid rgba(232,0,10,.2);font-size:9px;font-weight:800;padding:3px 10px;border-radius:20px;z-index:2;}
.org-panel{background:var(--gray);border:1px solid var(--border);border-radius:var(--radius);padding:28px;margin-bottom:28px;}
.org-panel-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;flex-wrap:wrap;gap:10px;}
.org-panel-title{font-family:var(--display);font-size:28px;letter-spacing:1px;}
.test-card{background:var(--gray2);border:1px solid var(--border);border-radius:var(--radius);padding:24px 24px 20px;transition:transform .25s cubic-bezier(.4,0,.2,1),border-color .25s,box-shadow .25s;position:relative;overflow:hidden;}
.test-card:hover{transform:translateY(-6px) scale(1.02);border-color:rgba(232,0,10,.5);box-shadow:0 20px 50px rgba(0,0,0,.5);}
.gal-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;}
.gal-item{position:relative;border-radius:var(--radius-sm);overflow:hidden;aspect-ratio:4/3;cursor:pointer;border:1px solid var(--border);background:#0a0a0a;transition:border-color .25s,transform .25s;}
.gal-item:hover{border-color:rgba(232,0,10,.5);transform:scale(1.02);}
.gal-item img{width:100%;height:100%;object-fit:cover;transition:opacity .3s;}
.gal-item:hover img{opacity:.85;}
.gal-caption{position:absolute;bottom:0;left:0;right:0;padding:10px 12px;background:linear-gradient(transparent,rgba(0,0,0,.8));font-size:12px;color:#fff;font-weight:600;}
.qnav-btn{background:none;border:none;border-bottom:2px solid transparent;color:var(--text3);font-family:var(--font);font-size:11px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;padding:13px 24px;cursor:pointer;white-space:nowrap;flex-shrink:0;transition:all .2s;}
.qnav-btn:hover{color:var(--text2);}
.qnav-btn.qnav-on{color:#fff;border-bottom-color:var(--red);}
@media(max-width:600px){
  .frow2{grid-template-columns:1fr;}
  .atabs{flex-wrap:wrap;row-gap:4px;}
  .atab{font-size:10px;padding:8px 10px;}
  .admin-ci{flex-wrap:wrap;}
  .cfoot-btns{flex-direction:column;width:100%;gap:6px;}
  .cbtn,.cbtn-info{width:100%;justify-content:center;}
}


/* ACCESIBILIDAD Y PERFORMANCE */
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #fff;outline-offset:3px;}
@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important;}#bg-canvas{display:none!important;}}
@media(max-width:768px){#bg-canvas{display:none!important;}.grain-overlay{opacity:.22;}.hero-h1{letter-spacing:2px}.nav{padding:0 14px}.logo-sub{display:none}.cursos-grid{grid-template-columns:1fr}.mbox{padding:26px 20px 32px}}

/* MEJORAS ADMIN PLANILLAS + ESTADÍSTICAS */
.admin-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-bottom:14px;}
.admin-metric{background:#0d0d0d;border:1px solid var(--border);border-radius:14px;padding:12px 14px;}
.admin-metric-n{font-family:var(--display);font-size:28px;line-height:1;color:var(--red);letter-spacing:1px;}
.admin-metric-l{font-size:10px;color:var(--text3);font-weight:800;text-transform:uppercase;letter-spacing:.1em;margin-top:4px;}
.planilla-toolbar{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap;align-items:center;}
.planilla-toolbar .finput{margin:0;flex:1;max-width:340px;min-width:220px;}
.planilla-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12px;min-width:880px;}
.planilla-table th{background:#121212;color:#888;padding:11px 10px;border-bottom:1px solid var(--border);font-size:10px;letter-spacing:.12em;text-transform:uppercase;}
.planilla-table td{padding:11px 10px;border-bottom:1px solid #202020;vertical-align:middle;}
.planilla-table tr:hover td{background:rgba(232,0,10,.025);}
.row-index{color:#777;font-size:12px;text-align:center;font-weight:700;}
.student-name{font-size:13px;font-weight:800;color:#fff;line-height:1.25;}
.student-sub{font-size:10px;color:var(--text3);margin-top:3px;}
.course-cell{max-width:190px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#ddd;font-weight:700;}
.pay-pill{display:inline-flex;align-items:center;gap:5px;border-radius:999px;padding:5px 9px;font-size:10px;font-weight:800;border:1px solid transparent;white-space:nowrap;}
.pay-ok{background:#0e2d1b;color:#39d477;border-color:#155c34;}
.pay-pa{background:#342600;color:#f5c842;border-color:#6c5208;}
.pay-pe{background:#341010;color:#ff5555;border-color:#5c1515;}
.action-mini{display:flex;gap:5px;align-items:center;justify-content:flex-end;flex-wrap:wrap;}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px;}
.stats-mini-card{background:#0d0d0d;border:1px solid var(--border);border-radius:14px;padding:14px;}
.stats-mini-title{font-size:11px;color:var(--text3);font-weight:800;letter-spacing:.12em;text-transform:uppercase;margin-bottom:8px;}
.stats-mini-value{font-family:var(--display);font-size:32px;color:var(--red);line-height:1;}
.stats-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid #1f1f1f;font-size:12px;}
.stats-row:last-child{border-bottom:none;}
@media(max-width:700px){.planilla-toolbar .finput{max-width:none;width:100%;}.admin-metrics{grid-template-columns:repeat(2,1fr);}.action-mini{justify-content:flex-start;}}

/* AJUSTES PLANILLA COMPACTA */
.planilla-table{table-layout:fixed;min-width:980px;}
.planilla-table th,.planilla-table td{overflow:hidden;text-overflow:ellipsis;}
.planilla-table th:nth-child(1),.planilla-table td:nth-child(1){width:42px;text-align:center;}
.planilla-table th:nth-child(2),.planilla-table td:nth-child(2){width:175px;}
.planilla-table th:nth-child(3),.planilla-table td:nth-child(3){width:62px;}
.planilla-table th:nth-child(4),.planilla-table td:nth-child(4){width:90px;}
.planilla-table th:nth-child(5),.planilla-table td:nth-child(5){width:180px;}
.planilla-table th:nth-child(6),.planilla-table td:nth-child(6){width:125px;}
.planilla-table th:nth-child(7),.planilla-table td:nth-child(7){width:125px;}
.planilla-table th:nth-child(8),.planilla-table td:nth-child(8){width:115px;}
.planilla-table th:nth-child(9),.planilla-table td:nth-child(9){width:155px;}
.planilla-table th:nth-child(10),.planilla-table td:nth-child(10){width:145px;}
.planilla-table.no-course{min-width:820px;}
.planilla-table.no-course th:nth-child(5),.planilla-table.no-course td:nth-child(5){width:125px;}
.planilla-table.no-course th:nth-child(6),.planilla-table.no-course td:nth-child(6){width:125px;}
.planilla-table.no-course th:nth-child(7),.planilla-table.no-course td:nth-child(7){width:115px;}
.planilla-table.no-course th:nth-child(8),.planilla-table.no-course td:nth-child(8){width:170px;}
.planilla-table.no-course th:nth-child(9),.planilla-table.no-course td:nth-child(9){width:160px;}
.pay-summary{display:flex;align-items:center;gap:6px;min-width:0;}
.pay-summary-text{font-size:11px;color:var(--text2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:72px;}
.pay-chip-btn{background:#151515;border:1px solid #303030;color:#ddd;border-radius:20px;padding:5px 8px;font-size:10px;font-weight:800;cursor:pointer;font-family:var(--font);white-space:nowrap;}
.pay-chip-btn:hover{border-color:var(--red);color:#fff;}
.mini-input{width:100%;background:#0d0d0d;border:1px solid var(--border);color:#fff;border-radius:8px;padding:7px 8px;font-family:var(--font);font-size:12px;}
.print-title{display:none;}
@media print{.print-title{display:block}.no-print{display:none!important}body{background:#fff!important;color:#111!important}.planilla-table{min-width:0!important;font-size:10px}.planilla-table th{background:#111!important;color:#fff!important}.planilla-table td{color:#111!important;border-bottom:1px solid #ddd!important}.student-name{color:#111!important}.student-sub,.tds{color:#555!important}.pay-pill{border:1px solid #bbb!important;color:#111!important;background:#eee!important}.tbl-wrap{overflow:visible!important}.acard{border:none!important;background:#fff!important}}



/* v6 ajustes planilla/admin */
.admin-wrap{max-width:1280px;}
.acard.planilla-card{padding:18px 20px;}
.tbl-wrap{overflow-x:auto;max-width:100%;scrollbar-width:thin;}
.planilla-table{table-layout:fixed;min-width:0!important;width:100%;font-size:11.5px;}
.planilla-table th{padding:10px 8px;}
.planilla-table td{padding:10px 8px;}
.planilla-table th:nth-child(1),.planilla-table td:nth-child(1){width:34px!important;text-align:center;}
.planilla-table th:nth-child(2),.planilla-table td:nth-child(2){width:19%!important;}
.planilla-table th:nth-child(3),.planilla-table td:nth-child(3){width:48px!important;}
.planilla-table th:nth-child(4),.planilla-table td:nth-child(4){width:78px!important;}
.planilla-table th:nth-child(5),.planilla-table td:nth-child(5){width:16%!important;}
.planilla-table th:nth-child(6),.planilla-table td:nth-child(6){width:12%!important;}
.planilla-table th:nth-child(7),.planilla-table td:nth-child(7){width:105px!important;}
.planilla-table th:nth-child(8),.planilla-table td:nth-child(8){width:95px!important;}
.planilla-table th:nth-child(9),.planilla-table td:nth-child(9){width:150px!important;}
.planilla-table th:nth-child(10),.planilla-table td:nth-child(10){width:136px!important;}
.planilla-table.no-course th:nth-child(5),.planilla-table.no-course td:nth-child(5){width:13%!important;}
.planilla-table.no-course th:nth-child(6),.planilla-table.no-course td:nth-child(6){width:104px!important;}
.planilla-table.no-course th:nth-child(7),.planilla-table.no-course td:nth-child(7){width:94px!important;}
.planilla-table.no-course th:nth-child(8),.planilla-table.no-course td:nth-child(8){width:160px!important;}
.planilla-table.no-course th:nth-child(9),.planilla-table.no-course td:nth-child(9){width:150px!important;}
.pay-summary{gap:5px;}
.pay-summary-text{display:none;}
.pay-chip-btn{padding:6px 9px;font-size:10px;}
.action-mini{gap:4px;justify-content:flex-start;}
.action-mini .bsm{padding:6px 8px;font-size:10px;}
.planilla-title{font-family:var(--display);font-size:32px;letter-spacing:1.4px;margin:0 0 10px;color:#fff;line-height:1;}
.planilla-title em{color:var(--red);font-style:normal;}
.test-admin-avatar{width:42px;height:42px;border-radius:50%;object-fit:cover;background:#222;display:inline-flex;align-items:center;justify-content:center;margin-right:10px;vertical-align:middle;overflow:hidden;}
.test-admin-avatar img{width:100%;height:100%;object-fit:cover;}
@media(max-width:900px){.planilla-table{min-width:900px!important}.tbl-wrap{overflow-x:auto}.admin-wrap{padding-left:12px;padding-right:12px}}
@media print{*{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}.print-title{display:block}.no-print{display:none!important}body{background:#fff!important;color:#111!important}.head{background:#111!important;color:#fff!important}.planilla-table{min-width:0!important;font-size:9px!important}.planilla-table th{background:#e8000a!important;color:#fff!important}.planilla-table td{color:#111!important;border:1px solid #ddd!important}.student-name{color:#111!important}.student-sub,.tds{color:#555!important}.pay-pill{border:1px solid #bbb!important;color:#111!important;background:#eee!important}.tbl-wrap{overflow:visible!important}.acard{border:none!important;background:#fff!important}}


.planilla-table{min-width:0!important;table-layout:fixed;}
.planilla-table th:nth-child(1),.planilla-table td:nth-child(1){width:36px!important;text-align:center;}
.planilla-table th:nth-child(2),.planilla-table td:nth-child(2){width:215px!important;}
.planilla-table th:nth-child(3),.planilla-table td:nth-child(3){width:58px!important;}
.planilla-table th:nth-child(4),.planilla-table td:nth-child(4){width:86px!important;}
.planilla-table th:nth-child(5),.planilla-table td:nth-child(5){width:145px!important;}
.planilla-table.no-course th:nth-child(5),.planilla-table.no-course td:nth-child(5){width:155px!important;}
.planilla-table th:nth-last-child(2),.planilla-table td:nth-last-child(2){width:250px!important;}
.planilla-table th:last-child,.planilla-table td:last-child{width:180px!important;}
.tbl-wrap{padding-bottom:4px;}
.admin-wrap{max-width:1240px;}


/* CHAT FLOTANTE */
.chat-fab{position:fixed;right:24px;bottom:84px;z-index:850;width:64px;height:64px;border-radius:50%;border:2px solid rgba(255,255,255,.18);background:radial-gradient(circle at 30% 20%,#ff3a42,var(--red) 55%,#830006);color:#fff;font-size:28px;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 0 rgba(232,0,10,.45),0 18px 50px rgba(232,0,10,.28);animation:chatPulse 2.4s infinite;transition:transform .2s,box-shadow .2s,background .2s;}
.chat-fab:hover{transform:translateY(-4px) scale(1.05);box-shadow:0 20px 60px rgba(232,0,10,.45),0 0 0 8px rgba(232,0,10,.12);}
.chat-fab .chat-dot{position:absolute;right:5px;top:5px;width:15px;height:15px;border-radius:50%;background:#e8000a;border:2px solid #111;display:none;box-shadow:0 0 0 4px rgba(232,0,10,.18);}
.chat-fab.has-new{background:radial-gradient(circle at 30% 20%,#ff5a60,#ff0010 55%,#b00008);box-shadow:0 0 0 8px rgba(232,0,10,.14),0 18px 50px rgba(232,0,10,.42);}
.chat-fab.has-new .chat-dot{display:block;animation:blink 1s infinite;}
.chat-fab.auto-on{background:radial-gradient(circle at 30% 20%,#2dff7a,#047a33 55%,#06451f);box-shadow:0 0 0 8px rgba(45,255,122,.12),0 18px 50px rgba(45,255,122,.28);}
.chat-fab.auto-on::after{content:'AUTO';position:absolute;left:50%;top:-18px;transform:translateX(-50%);background:#04a64b;color:#fff;border:1px solid rgba(255,255,255,.22);border-radius:999px;padding:2px 7px;font-size:9px;font-weight:900;letter-spacing:.08em;}
.chat-fab.auto-on.has-new{background:radial-gradient(circle at 30% 20%,#ff5a60,#ff0010 55%,#b00008);}
@keyframes chatPulse{0%{box-shadow:0 0 0 0 rgba(232,0,10,.45),0 18px 50px rgba(232,0,10,.28)}70%{box-shadow:0 0 0 14px rgba(232,0,10,0),0 18px 50px rgba(232,0,10,.28)}100%{box-shadow:0 0 0 0 rgba(232,0,10,0),0 18px 50px rgba(232,0,10,.28)}}
.chat-panel{display:flex;flex-direction:column;gap:10px;max-height:62vh;}
.chat-head{display:flex;align-items:center;gap:12px;margin-bottom:12px;}
.chat-avatar{width:42px;height:42px;border-radius:50%;background:linear-gradient(135deg,var(--red),#810006);display:flex;align-items:center;justify-content:center;font-size:22px;box-shadow:0 0 30px rgba(232,0,10,.2);}
.chat-title{font-family:var(--display);font-size:28px;letter-spacing:1px;line-height:1;}
.chat-subline{font-size:12px;color:var(--text3);margin-top:3px;}
.chat-msgs{background:#070707;border:1px solid var(--border);border-radius:18px;padding:14px;min-height:310px;max-height:430px;overflow-y:auto;display:flex;flex-direction:column;gap:9px;scrollbar-width:thin;scrollbar-color:var(--red) #111;}
.chat-msgs::-webkit-scrollbar{width:8px;}
.chat-msgs::-webkit-scrollbar-track{background:#111;border-radius:20px;}
.chat-msgs::-webkit-scrollbar-thumb{background:linear-gradient(var(--red),#7d0007);border-radius:20px;border:2px solid #111;}
.chat-action-row{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px;}
.chat-action-btn{border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.08);color:#fff;border-radius:18px;padding:7px 11px;font-size:11px;font-weight:900;cursor:pointer;font-family:var(--font);transition:.2s;}
.chat-action-btn:hover{background:var(--red);border-color:var(--red);transform:translateY(-1px);}
.chat-bubble{max-width:84%;padding:11px 13px;border-radius:16px;font-size:13px;line-height:1.45;word-break:break-word;box-shadow:0 8px 22px rgba(0,0,0,.18);}
.chat-bubble.user{align-self:flex-start;background:#171717;border:1px solid #292929;color:#fff;border-bottom-left-radius:5px;}
.chat-bubble.admin{align-self:flex-end;background:linear-gradient(135deg,var(--red),#b5000a);color:#fff;border-bottom-right-radius:5px;}
.chat-bubble.system{align-self:center;max-width:95%;background:rgba(255,255,255,.04);border:1px solid var(--border);color:var(--text2);font-size:12px;text-align:center;box-shadow:none;}
.chat-bubble.typing{align-self:flex-end;background:rgba(232,0,10,.12);border:1px solid rgba(232,0,10,.22);color:#fff;box-shadow:none;font-size:12px;}
.chat-bubble.typing::after{content:'...';animation:typingDots 1.1s infinite;}
@keyframes typingDots{0%{content:'.'}33%{content:'..'}66%{content:'...'}}
.chat-meta{font-size:9px;color:rgba(255,255,255,.45);margin-top:4px;}
.chat-row{display:flex;gap:8px;align-items:center;background:#0b0b0b;border:1px solid var(--border);border-radius:50px;padding:6px;}
.chat-row .finput{margin:0;border:none;background:transparent;padding:11px 14px;}
.chat-row .finput:focus{border:none;box-shadow:none;}
.chat-send{width:46px;height:46px;border-radius:50%;background:var(--red);border:none;color:#fff;font-size:19px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:.2s;flex-shrink:0;}
.chat-send:hover{background:var(--red2);transform:scale(1.04);}
.chat-name-row{display:flex;gap:8px;background:#0b0b0b;border:1px solid var(--border);border-radius:16px;padding:8px;margin-top:10px;}
.chat-name-row .finput{margin:0;}
.chat-list-item{border:1px solid var(--border);background:#0d0d0d;border-radius:14px;padding:12px;display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;cursor:pointer;transition:.2s;}
.chat-list-item:hover{border-color:rgba(232,0,10,.45);background:#151010;}
.chat-list-item.unread{border-color:rgba(232,0,10,.65);background:rgba(232,0,10,.06);}
.chat-status{font-size:10px;font-weight:800;border-radius:20px;padding:3px 9px;background:rgba(255,255,255,.06);color:var(--text3);}
.chat-status.on{background:rgba(76,175,125,.12);color:#4caf7d;}
.chat-status.new{background:rgba(232,0,10,.15);color:#ff5555;}
.chat-wa-soft{display:inline-flex;align-items:center;gap:6px;margin-top:10px;color:#25d366;text-decoration:none;font-size:12px;border:1px solid rgba(37,211,102,.25);padding:8px 12px;border-radius:20px;background:rgba(37,211,102,.06);}
.chat-popover{position:fixed;right:24px;bottom:158px;z-index:849;width:min(390px,calc(100vw - 32px));max-height:70vh;background:linear-gradient(180deg,#151515,#080808);border:1px solid rgba(255,255,255,.12);border-radius:24px;box-shadow:0 28px 90px rgba(0,0,0,.72),0 0 0 1px rgba(232,0,10,.18),0 0 70px rgba(232,0,10,.16);display:none;overflow:hidden;animation:chatPop .22s cubic-bezier(.16,1,.3,1);}
.chat-popover.open{display:block;}
.chat-popover.expanded{width:min(980px,calc(100vw - 48px));max-height:88vh;right:24px;bottom:96px;}
.chat-popover.expanded .chat-msgs{min-height:520px;max-height:62vh;}
.chat-online-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#555;margin-right:5px;box-shadow:0 0 0 3px rgba(255,255,255,.04);vertical-align:middle;}
.chat-online-dot.on{background:#4caf7d;box-shadow:0 0 0 4px rgba(76,175,125,.15),0 0 14px rgba(76,175,125,.45);}
.chat-presence-text{font-size:11px;color:var(--text3);margin-top:2px;}
.chat-max-btn{position:absolute;top:12px;right:48px;width:30px;height:30px;border-radius:50%;border:none;background:rgba(255,255,255,.08);color:#fff;cursor:pointer;font-size:14px;z-index:2;}
.chat-max-btn:hover{background:var(--red);}
@media(max-width:700px){.chat-popover.expanded{left:8px;right:8px;bottom:110px;width:auto;max-height:78vh}.chat-popover.expanded .chat-msgs{min-height:300px;max-height:54vh}}
@keyframes chatPop{from{opacity:0;transform:translateY(18px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}
.chat-popover-inner{padding:16px;}
.chat-popover-close{position:absolute;top:12px;right:12px;width:30px;height:30px;border-radius:50%;border:none;background:rgba(255,255,255,.08);color:#fff;cursor:pointer;font-size:15px;z-index:2;}
.chat-popover-close:hover{background:var(--red);}
.chat-quick-wrap{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px;}
.chat-quick{border:1px solid rgba(232,0,10,.28);background:rgba(232,0,10,.08);color:#fff;border-radius:18px;padding:7px 10px;font-size:11px;font-weight:800;cursor:pointer;font-family:var(--font);transition:.2s;}
.chat-quick:hover{background:var(--red);transform:translateY(-1px);}
.chat-link{color:#7dd3fc;text-decoration:underline;text-underline-offset:2px;font-weight:800;}
.chat-link.ig{color:#ff5ca8;}
.chat-edit-mini{display:inline-flex;margin-left:6px;border:none;background:rgba(255,255,255,.12);color:rgba(255,255,255,.75);border-radius:10px;padding:2px 6px;font-size:10px;cursor:pointer;vertical-align:middle;}
.chat-edit-mini:hover{background:rgba(255,255,255,.25);color:#fff;}
.admin-search-box{display:flex;gap:8px;align-items:center;background:#0d0d0d;border:1px solid var(--border);border-radius:var(--radius-sm);padding:10px 12px;margin-bottom:12px;flex-wrap:wrap;}
.admin-search-input{flex:1;min-width:240px;margin:0!important;}
.admin-search-results{display:none;margin-bottom:14px;background:#0b0b0b;border:1px solid var(--border);border-radius:var(--radius-sm);padding:12px;}
.admin-search-results.on{display:block;}
.admin-result-row{display:grid;grid-template-columns:95px 1.5fr 1.2fr 1fr auto;gap:10px;align-items:center;padding:8px 0;border-bottom:1px solid rgba(255,255,255,.06);font-size:12px;}
.admin-result-row:last-child{border-bottom:none;}
.admin-result-type{font-size:10px;font-weight:900;color:var(--red);text-transform:uppercase;letter-spacing:.08em;}
.admin-result-main{font-weight:800;color:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.admin-result-sub{color:var(--text3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.extra-link-btn{display:inline-flex;align-items:center;gap:6px;padding:9px 14px;border-radius:999px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.1);color:#fff;text-decoration:none;font-size:12px;font-weight:800;margin-top:8px;}
.extra-link-btn:hover{background:rgba(232,0,10,.16);border-color:rgba(232,0,10,.35);color:#fff;}
.chat-filter{border:1px solid var(--border);background:#0b0b0b;color:var(--text3);border-radius:18px;padding:7px 11px;font-size:11px;font-weight:800;cursor:pointer;font-family:var(--font);}
.chat-filter.on{background:rgba(232,0,10,.16);border-color:rgba(232,0,10,.45);color:#fff;}
.chat-trash{border:none;background:rgba(232,0,10,.12);color:#ff6b6b;border-radius:50%;width:28px;height:28px;cursor:pointer;font-size:13px;flex-shrink:0;}
.chat-trash:hover{background:var(--red);color:#fff;}

.admin-live-indicator{position:fixed;left:24px;bottom:24px;z-index:860;display:none;align-items:center;gap:8px;background:rgba(12,12,12,.92);border:1px solid rgba(76,175,125,.35);color:#4caf7d;padding:9px 14px;border-radius:999px;font-size:12px;font-weight:800;box-shadow:0 12px 40px rgba(0,0,0,.45);backdrop-filter:blur(12px);}
.admin-live-indicator.on{display:flex;}
.admin-live-dot{width:9px;height:9px;border-radius:50%;background:#4caf7d;box-shadow:0 0 0 5px rgba(76,175,125,.12);animation:blink 1.4s infinite;}
.admin-live-indicator.off{display:flex;border-color:rgba(232,0,10,.35);color:#ff5555;}
.admin-live-indicator.off .admin-live-dot{background:#ff5555;box-shadow:0 0 0 5px rgba(232,0,10,.12);}
.chat-tabs{display:flex;gap:6px;overflow-x:auto;padding:0 0 8px;margin:-4px 0 8px;scrollbar-width:thin;}
.chat-tab{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);background:#0e0e0e;color:var(--text2);border-radius:18px;padding:7px 10px;font-size:11px;font-weight:800;cursor:pointer;white-space:nowrap;max-width:130px;}
.chat-tab.active{background:rgba(232,0,10,.16);border-color:rgba(232,0,10,.55);color:#fff;}
.chat-tab.unread::before{content:'';width:7px;height:7px;border-radius:50%;background:var(--red);box-shadow:0 0 0 4px rgba(232,0,10,.13);flex-shrink:0;}
.chat-tab-name{overflow:hidden;text-overflow:ellipsis;}
.chat-tab-close{border:none;background:rgba(255,255,255,.08);color:var(--text3);border-radius:50%;width:18px;height:18px;line-height:18px;font-size:10px;cursor:pointer;flex-shrink:0;}
.chat-tab-close:hover{background:var(--red);color:#fff;}


.chat-head-actions{margin-left:auto;display:flex;align-items:center;gap:6px;padding-right:34px;}
.chat-icon-btn{width:30px;height:30px;border-radius:50%;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.06);color:#fff;cursor:pointer;font-size:14px;display:inline-flex;align-items:center;justify-content:center;transition:.2s;}
.chat-icon-btn:hover{background:var(--red);border-color:var(--red);transform:translateY(-1px);}
.chat-clean-btn{border:1px solid rgba(232,0,10,.35);background:rgba(232,0,10,.08);color:#ff7777;border-radius:18px;padding:7px 11px;font-size:11px;font-weight:800;cursor:pointer;font-family:var(--font);}
.chat-clean-btn:hover{background:var(--red);color:#fff;}

.chat-admin-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:8px;}
.chat-admin-actions .btn-out,.chat-admin-actions a.btn-out{min-width:0!important;width:100%;font-size:11px;padding:9px 6px;margin-top:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.chat-admin-actions .danger{color:#ff7777!important;border-color:rgba(232,0,10,.35)!important;}
@media(max-width:700px){.chat-admin-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.chat-admin-actions .btn-out,.chat-admin-actions a.btn-out{font-size:10px;padding:8px 4px;border-radius:18px}.chat-head .chat-title{font-size:24px}}

/* Ajustes v32.3: chat expandido, buscador cerebro y visor links */
.chat-popover.expanded .chat-popover-inner{max-height:calc(88vh - 34px);overflow-y:auto;padding-bottom:18px;scrollbar-width:thin;scrollbar-color:var(--red) #111;}
.chat-popover.expanded .chat-popover-inner::-webkit-scrollbar{width:8px;}
.chat-popover.expanded .chat-popover-inner::-webkit-scrollbar-track{background:#111;border-radius:20px;}
.chat-popover.expanded .chat-popover-inner::-webkit-scrollbar-thumb{background:linear-gradient(var(--red),#7d0007);border-radius:20px;border:2px solid #111;}
.chat-popover.expanded .chat-admin-actions{position:sticky;bottom:-18px;background:linear-gradient(180deg,rgba(8,8,8,.72),#080808 32%,#080808);padding-top:10px;padding-bottom:4px;z-index:3;}
.chat-open-inline{display:inline-flex;align-items:center;margin-left:5px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.06);color:#fff;border-radius:999px;padding:2px 7px;font-size:10px;font-weight:900;cursor:pointer;font-family:var(--font);vertical-align:middle;}
.chat-open-inline:hover{background:var(--red);border-color:var(--red);}
.ai-selector-search{position:sticky;top:0;z-index:2;background:var(--gray);padding:0 0 10px;margin-bottom:4px;}
.web-preview-frame{width:100%;height:min(72vh,720px);border:1px solid var(--border);border-radius:14px;background:#fff;display:block;}
.web-preview-note{font-size:11px;color:var(--text3);line-height:1.45;margin:8px 0 12px;}



/* Ajustes v32.3: barra admin compacta/scroll y buscador del cerebro en admin */
.chat-admin-actions{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;gap:6px!important;padding:6px 2px 8px!important;scrollbar-width:thin;scrollbar-color:var(--red) #111;}
.chat-admin-actions::-webkit-scrollbar{height:7px;}
.chat-admin-actions::-webkit-scrollbar-track{background:#111;border-radius:20px;}
.chat-admin-actions::-webkit-scrollbar-thumb{background:linear-gradient(90deg,var(--red),#7d0007);border-radius:20px;}
.chat-admin-actions .btn-out,.chat-admin-actions a.btn-out{flex:0 0 auto!important;width:auto!important;min-width:74px!important;max-width:none!important;padding:8px 10px!important;font-size:10.5px!important;}
.chat-popover.expanded .chat-admin-actions{position:relative!important;bottom:auto!important;background:#080808!important;padding-top:8px!important;}
.ai-admin-search{margin-bottom:12px;}

/* ASISTENTE */
.ai-pill{display:inline-flex;align-items:center;gap:6px;border:1px solid rgba(232,0,10,.28);background:rgba(232,0,10,.08);color:#fff;border-radius:18px;padding:5px 9px;font-size:10px;font-weight:800;margin:2px;}
.ai-item{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;border:1px solid var(--border);background:#0d0d0d;border-radius:var(--radius-sm);padding:14px;margin-bottom:8px;}
.ai-item-title{font-size:14px;font-weight:800;margin-bottom:4px;}
.ai-item-answer{font-size:12px;color:var(--text2);line-height:1.55;white-space:pre-line;max-height:90px;overflow:auto;}
.ai-auto-note{align-self:center;max-width:95%;background:rgba(232,0,10,.06);border:1px solid rgba(232,0,10,.18);color:var(--text2);font-size:11px;text-align:center;box-shadow:none;border-radius:16px;padding:8px 10px;}
.gal-card{background:var(--gray2);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;transition:transform .25s,border-color .25s,box-shadow .25s;}
.gal-card:hover{transform:translateY(-5px);border-color:rgba(232,0,10,.45);box-shadow:0 20px 45px rgba(0,0,0,.45);}
.gal-card-img{aspect-ratio:4/3;background:#080808;overflow:hidden;}
.gal-card-img img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .35s,opacity .25s;}
.gal-card:hover .gal-card-img img{transform:scale(1.04);opacity:.92;}
.gal-card-caption{padding:12px 14px;font-size:13px;color:#fff;font-weight:700;line-height:1.35;min-height:48px;background:linear-gradient(180deg,#181818,#111);}
.gal-sec-head{align-items:center;text-align:left;}
.gal-sec-head .sec-sub{text-align:right;max-width:320px;}
@media(max-width:700px){.gal-sec-head{align-items:flex-start}.gal-sec-head .sec-sub{text-align:left}.chat-head-actions{padding-right:32px}.chat-clean-btn{font-size:10px;padding:7px 9px}}

@media(max-width:700px){.cfoot{flex-direction:column;align-items:stretch}.cfoot-btns{width:100%;display:grid;grid-template-columns:1fr 1fr}.cbtn,.cbtn-info{width:100%;padding:10px 8px;font-size:11px}.chat-fab{right:18px;bottom:78px;width:56px;height:56px;font-size:24px}.chat-popover{right:12px;left:12px;bottom:145px;width:auto;max-height:72vh}.chat-row{border-radius:22px}.chat-bubble{max-width:94%;}.chat-msgs{min-height:260px;max-height:48vh}.chat-name-row{flex-direction:column}}


/* Ajustes v25 */
.hero{padding-top:64px;}
.hero-live-line{margin:34px 0 10px;}
.hero-scroll{display:none!important;}
#quick-nav{position:relative!important;top:auto!important;left:auto!important;right:auto!important;transform:translateY(-110px)!important;width:fit-content!important;max-width:calc(100vw - 36px)!important;margin:0 auto -66px!important;background:rgba(12,12,12,.42)!important;backdrop-filter:blur(18px)!important;border:1px solid rgba(255,255,255,.07)!important;border-radius:999px!important;box-shadow:0 18px 45px rgba(0,0,0,.42),0 0 38px rgba(232,0,10,.08)!important;overflow:hidden!important;z-index:4!important;}
#quick-nav>div{justify-content:center;gap:7px;padding:8px 10px;scrollbar-width:none;}
#quick-nav>div::-webkit-scrollbar{display:none;}
.qnav-btn{border:1px solid rgba(255,255,255,.07);border-radius:999px;padding:10px 18px;background:rgba(255,255,255,.045);box-shadow:inset 0 0 0 1px rgba(255,255,255,.02);}
.qnav-btn:hover{background:rgba(232,0,10,.12);color:#fff;transform:translateY(-1px);}
.qnav-btn.qnav-on{background:linear-gradient(135deg,rgba(232,0,10,.95),rgba(150,0,8,.9));border-color:rgba(255,255,255,.12);color:#fff;}
.logo-sub{display:flex;align-items:center;gap:6px;}
.admin-live-indicator{position:static!important;display:none!important;width:max-content;margin:0;background:rgba(0,0,0,.25);border:1px solid rgba(76,175,125,.45);color:#4caf7d;padding:1px 6px;border-radius:999px;font-size:8px;font-weight:900;letter-spacing:.08em;box-shadow:none;backdrop-filter:none;line-height:1.3;}
.admin-live-indicator.on,.admin-live-indicator.off{display:inline-flex!important;}
.admin-live-indicator.off{display:none!important;}
@media(max-width:860px){#quick-nav{transform:translateY(-88px)!important;max-width:calc(100vw - 22px)!important;margin-bottom:-50px!important;}#quick-nav>div{justify-content:flex-start}.qnav-btn{padding:8px 13px;font-size:10px}.hero{padding-top:80px;}}




/* v32.6 - chat admin más limpio: iconos, copiar tokens y alertas de pestañas */
.chat-popover.expanded{right:50%!important;left:auto!important;transform:translateX(50%)!important;width:min(1080px,calc(100vw - 28px))!important;bottom:64px!important;max-height:90vh!important;}
.chat-popover.expanded .chat-popover-inner{max-height:calc(90vh - 30px)!important;padding-bottom:24px!important;}
.chat-popover.expanded .chat-msgs{min-height:500px;max-height:58vh!important;}
.chat-popover.expanded .chat-admin-actions{padding-bottom:12px!important;margin-bottom:0!important;}
.chat-quick-wrap{display:flex!important;gap:7px!important;flex-wrap:nowrap!important;overflow-x:auto!important;padding:4px 2px 8px!important;margin-top:6px!important;scrollbar-width:thin;scrollbar-color:var(--red) #111;}
.chat-quick-wrap::-webkit-scrollbar{height:6px;}
.chat-quick-wrap::-webkit-scrollbar-track{background:#111;border-radius:20px;}
.chat-quick-wrap::-webkit-scrollbar-thumb{background:linear-gradient(90deg,var(--red),#7d0007);border-radius:20px;}
.chat-quick{flex:0 0 auto!important;width:36px!important;height:36px!important;min-width:36px!important;border-radius:50%!important;padding:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;font-size:15px!important;line-height:1!important;}
.chat-quick .qr-text{display:none!important;}
.chat-quick .qr-ico{font-size:16px;line-height:1;}
.chat-admin-actions{justify-content:flex-start!important;padding-right:74px!important;}
.chat-admin-actions .btn-out,.chat-admin-actions a.btn-out{min-width:42px!important;width:42px!important;height:42px!important;border-radius:50%!important;padding:0!important;font-size:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;overflow:visible!important;}
.chat-admin-actions .btn-out .ico,.chat-admin-actions a.btn-out .ico{font-size:17px!important;line-height:1!important;}
.chat-tab.unread{border-color:rgba(232,0,10,.75)!important;color:#fff!important;animation:chatTabPulse 1.2s ease-in-out infinite;}
@keyframes chatTabPulse{0%,100%{box-shadow:0 0 0 rgba(232,0,10,0)}50%{box-shadow:0 0 18px rgba(232,0,10,.55)}}
.chat-copy-card{display:inline-flex;align-items:center;gap:8px;margin:4px 0;padding:7px 9px;border-radius:13px;background:rgba(0,0,0,.22);border:1px solid rgba(255,255,255,.18);font-weight:900;word-break:break-all;}
.chat-copy-btn{border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.10);color:#fff;border-radius:999px;padding:4px 8px;font-size:10px;font-weight:900;cursor:pointer;font-family:var(--font);white-space:nowrap;}
.chat-copy-btn:hover{background:#fff;color:#111;}
.chat-admin-tools{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:8px;}
.chat-admin-tools .chat-filter{width:36px;height:32px;padding:0;display:inline-flex;align-items:center;justify-content:center;font-size:12px;}
.chat-admin-tools .chat-filter.auto{width:auto;padding:0 10px;}
.chat-quick-label{font-size:10px;color:var(--text3);margin-top:6px;}
@media(max-width:700px){
  .chat-popover.expanded{left:8px!important;right:8px!important;transform:none!important;bottom:96px!important;width:auto!important;}
  .chat-popover.expanded .chat-msgs{min-height:300px;max-height:50vh!important;}
  .chat-admin-actions{padding-right:58px!important;}
  .chat-admin-actions .btn-out,.chat-admin-actions a.btn-out{min-width:38px!important;width:38px!important;height:38px!important;}
}



/* v32.7 - ajuste final chat: layout sin barras inútiles, fullscreen centrado y copiar sólo para tokens cortos */
.chat-popover{width:min(430px,calc(100vw - 20px))!important;bottom:112px!important;max-height:min(82vh,760px)!important;}
.chat-popover-inner{display:flex!important;flex-direction:column!important;max-height:inherit!important;overflow:hidden!important;padding:18px!important;}
.chat-panel{display:flex!important;flex-direction:column!important;min-height:0!important;flex:1 1 auto!important;overflow:hidden!important;}
.chat-msgs{flex:1 1 auto!important;min-height:250px!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;}
.chat-row{flex-shrink:0!important;}
.chat-admin-tools,.chat-quick-label,.chat-quick-wrap,.chat-admin-actions{flex-shrink:0!important;}
.chat-admin-actions{display:flex!important;flex-wrap:wrap!important;overflow:visible!important;padding:6px 0 4px!important;gap:7px!important;justify-content:flex-start!important;}
.chat-admin-actions .btn-out,.chat-admin-actions a.btn-out{min-width:40px!important;width:40px!important;height:40px!important;}
.chat-quick-wrap{overflow-x:visible!important;flex-wrap:wrap!important;padding:4px 0 6px!important;}
.chat-popover.expanded{left:50%!important;right:auto!important;bottom:34px!important;transform:translateX(-50%)!important;width:min(1120px,calc(100vw - 54px))!important;max-height:calc(100vh - 68px)!important;}
.chat-popover.expanded .chat-popover-inner{max-height:calc(100vh - 92px)!important;overflow:hidden!important;padding-bottom:18px!important;}
.chat-popover.expanded .chat-msgs{min-height:360px!important;max-height:none!important;}
.chat-popover.expanded ~ .chat-fab{display:none!important;}
.chat-link{word-break:break-word;}
.chat-copy-card{max-width:100%;}
@media(min-width:701px){
  .chat-popover.expanded .chat-panel{height:calc(100vh - 220px)!important;}
}
@media(max-width:700px){
  .chat-popover{left:10px!important;right:10px!important;width:auto!important;bottom:96px!important;max-height:calc(100vh - 126px)!important;}
  .chat-popover.expanded{left:8px!important;right:8px!important;bottom:86px!important;width:auto!important;transform:none!important;max-height:calc(100vh - 106px)!important;}
  .chat-popover.expanded .chat-popover-inner{max-height:calc(100vh - 126px)!important;}
  .chat-popover.expanded .chat-panel{height:calc(100vh - 250px)!important;}
  .chat-admin-actions .btn-out,.chat-admin-actions a.btn-out{min-width:38px!important;width:38px!important;height:38px!important;}
}


/* PATCH v33.1 - chat actions visible + expanded layout safer */
.chat-popover.expanded{left:50%!important;right:auto!important;bottom:28px!important;transform:translateX(-50%)!important;width:min(1160px,calc(100vw - 42px))!important;max-height:calc(100vh - 56px)!important;}
.chat-popover.expanded .chat-popover-inner{max-height:calc(100vh - 82px)!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;}
.chat-popover.expanded .chat-panel{flex:1 1 auto!important;min-height:0!important;display:flex!important;flex-direction:column!important;}
.chat-popover.expanded .chat-msgs{flex:1 1 auto!important;min-height:260px!important;max-height:none!important;}
.chat-admin-actions{display:flex!important;flex-wrap:wrap!important;overflow:visible!important;gap:7px!important;padding:6px 68px 8px 0!important;}
.chat-admin-actions .btn-out,.chat-admin-actions a.btn-out{min-width:40px!important;width:40px!important;height:40px!important;border-radius:50%!important;padding:0!important;font-size:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;}
.chat-admin-actions .btn-out .ico,.chat-admin-actions a.btn-out .ico{font-size:17px!important;line-height:1!important;}
.chat-quick-wrap{display:flex!important;flex-wrap:wrap!important;overflow:visible!important;gap:7px!important;padding:4px 68px 6px 0!important;}
.chat-quick{width:36px!important;height:36px!important;min-width:36px!important;border-radius:50%!important;padding:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;}
.chat-quick .qr-text{display:none!important;}
@media(max-width:700px){.chat-popover.expanded{left:8px!important;right:8px!important;transform:none!important;width:auto!important;bottom:86px!important;max-height:calc(100vh - 106px)!important}.chat-popover.expanded .chat-popover-inner{max-height:calc(100vh - 126px)!important}.chat-admin-actions,.chat-quick-wrap{padding-right:58px!important}.chat-admin-actions .btn-out,.chat-admin-actions a.btn-out{min-width:38px!important;width:38px!important;height:38px!important}}


/* v33.3 - ajustes finales chat: draggable/resizable, botonera plegable y layout */
.chat-popover{resize:both;min-width:360px;min-height:460px;max-width:calc(100vw - 24px);max-height:calc(100vh - 24px);}
.chat-popover.dragged{right:auto!important;bottom:auto!important;transform:none!important;}
.chat-head{cursor:move;}
.chat-head button,.chat-head a,.chat-head input,.chat-head .chat-tab{cursor:pointer;}
.chat-tools-collapsed .chat-quick-label,.chat-tools-collapsed .chat-quick-wrap,.chat-tools-collapsed .chat-admin-actions{display:none!important;}
.chat-tools-toggle.on{background:rgba(232,0,10,.18)!important;border-color:rgba(232,0,10,.5)!important;color:#fff!important;}
.chat-popover.expanded .chat-popover-inner{padding-bottom:18px!important;}
.chat-admin-tools{display:flex;gap:7px;flex-wrap:wrap;align-items:center;margin-top:8px;}
@media(max-width:700px){.chat-popover{resize:none;min-width:0}.chat-head{cursor:default}.chat-admin-tools{gap:6px}.chat-filter{padding:6px 9px;font-size:10px}}



/* ======================================================================
   TOMAUNO v33.13 — LIMPIEZA VISUAL DEL CHAT
   Regla de esta versión: NO tocar Firebase ni lógica JS.
   Objetivo: eliminar la pelea visual entre resize/expanded/sticky/max-height.
   ====================================================================== */
:root{
  --chat-w: min(520px, calc(100vw - 24px));
  --chat-w-expanded: min(1060px, calc(100vw - 32px));
  --chat-h-expanded: min(760px, calc(100vh - 44px));
  --chat-bottom: 96px;
}

/* Botón flotante: mantiene presencia, baja animación pesada */
.chat-fab{
  right:22px!important;
  bottom:78px!important;
  width:58px!important;
  height:58px!important;
  animation:none!important;
  transition:transform .16s ease, box-shadow .16s ease, background .16s ease!important;
}
.chat-fab:hover{transform:translateY(-2px) scale(1.03)!important;}

/* Ventana base: estable, sin resize nativo ni saltos de transform */
.chat-popover{
  position:fixed!important;
  right:22px!important;
  bottom:var(--chat-bottom)!important;
  left:auto!important;
  top:auto!important;
  width:var(--chat-w)!important;
  height:auto!important;
  min-width:0!important;
  min-height:0!important;
  max-width:calc(100vw - 24px)!important;
  max-height:calc(100vh - 118px)!important;
  resize:none!important;
  transform:none!important;
  overflow:hidden!important;
  border-radius:22px!important;
  animation:none!important;
  display:none;
}
.chat-popover.open{display:block!important;}
.chat-popover.dragged{right:auto!important;bottom:auto!important;transform:none!important;}

/* Ventana expandida: centrada y con tamaño fijo útil */
.chat-popover.expanded{
  left:50%!important;
  right:auto!important;
  bottom:22px!important;
  top:auto!important;
  transform:translateX(-50%)!important;
  width:var(--chat-w-expanded)!important;
  height:var(--chat-h-expanded)!important;
  min-width:0!important;
  min-height:0!important;
  max-width:calc(100vw - 32px)!important;
  max-height:calc(100vh - 44px)!important;
  resize:none!important;
}

/* Contenedor interno: layout vertical único */
.chat-popover-inner{
  height:100%!important;
  max-height:none!important;
  overflow:hidden!important;
  padding:16px!important;
  display:flex!important;
  flex-direction:column!important;
  gap:10px!important;
}

/* Panel: solo estructura, sin max-height conflictivo */
.chat-panel{
  flex:1 1 auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  gap:10px!important;
}

/* Header compacto y no draggable por defecto */
.chat-head{
  flex:0 0 auto!important;
  margin:0!important;
  cursor:default!important;
  gap:10px!important;
  min-height:42px!important;
}
.chat-avatar{width:38px!important;height:38px!important;font-size:20px!important;box-shadow:none!important;}
.chat-title{font-size:25px!important;line-height:1!important;}
.chat-subline,.chat-presence-text{font-size:11px!important;line-height:1.25!important;}
.chat-head-actions{padding-right:66px!important;gap:5px!important;}
.chat-icon-btn,.chat-max-btn,.chat-popover-close{
  width:30px!important;height:30px!important;min-width:30px!important;
}
.chat-popover-close{right:12px!important;top:12px!important;}
.chat-max-btn{right:48px!important;top:12px!important;}

/* Pestañas arriba: compactas, sin generar alto excesivo */
.chat-tabs{
  flex:0 0 auto!important;
  margin:0!important;
  padding:0 0 4px!important;
  gap:5px!important;
  max-height:34px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:thin!important;
}
.chat-tab{padding:6px 9px!important;font-size:10.5px!important;max-width:122px!important;}
.chat-tab.unread{animation:none!important;}

/* Mensajes: el único scroll real */
.chat-msgs{
  flex:1 1 auto!important;
  min-height:230px!important;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:13px!important;
  gap:9px!important;
  border-radius:16px!important;
  scroll-behavior:auto!important;
}
.chat-popover.expanded .chat-msgs{
  min-height:0!important;
  max-height:none!important;
}
.chat-bubble{
  max-width:88%!important;
  box-shadow:none!important;
  animation:none!important;
}
.chat-bubble.user{align-self:flex-start!important;}
.chat-bubble.admin{align-self:flex-end!important;}

/* Input fijo abajo, sin empujar con márgenes raros */
.chat-row{
  flex:0 0 auto!important;
  margin:0!important;
  border-radius:18px!important;
  padding:5px!important;
}
.chat-row .finput{padding:10px 12px!important;font-size:14px!important;}
.chat-send{width:42px!important;height:42px!important;min-width:42px!important;}

/* Herramientas y respuestas rápidas: compactas, sin sticky ni scroll interno vertical */
.chat-admin-tools,
.chat-quick-label,
.chat-quick-wrap,
.chat-admin-actions{
  flex:0 0 auto!important;
  position:static!important;
  bottom:auto!important;
  background:transparent!important;
  margin:0!important;
}
.chat-admin-tools{gap:6px!important;}
.chat-quick-label{font-size:10px!important;line-height:1.2!important;margin-top:0!important;}
.chat-quick-wrap{
  display:flex!important;
  flex-wrap:wrap!important;
  overflow:visible!important;
  padding:0!important;
  gap:6px!important;
  max-height:none!important;
}
.chat-quick{
  width:auto!important;
  height:30px!important;
  min-width:30px!important;
  border-radius:999px!important;
  padding:0 9px!important;
  font-size:11px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
.chat-quick .qr-text{display:inline!important;}
.chat-quick .qr-ico{font-size:13px!important;margin-right:4px!important;}
.chat-admin-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  overflow:visible!important;
  padding:0!important;
  gap:6px!important;
  justify-content:flex-start!important;
}
.chat-admin-actions .btn-out,
.chat-admin-actions a.btn-out{
  flex:0 0 auto!important;
  width:auto!important;
  min-width:34px!important;
  height:34px!important;
  border-radius:999px!important;
  padding:0 10px!important;
  font-size:11px!important;
  margin:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
.chat-admin-actions .btn-out .ico,
.chat-admin-actions a.btn-out .ico{font-size:14px!important;line-height:1!important;}

/* Estado plegado: si existe, respeta la intención sin romper alto */
.chat-tools-collapsed .chat-quick-label,
.chat-tools-collapsed .chat-quick-wrap,
.chat-tools-collapsed .chat-admin-actions{display:none!important;}

/* Mobile: chat tipo WhatsApp, sin bandejas ni ventana gigante */
@media(max-width:700px){
  html.chat-open-mobile, body.chat-open-mobile{overflow:hidden!important;}
  .chat-popover,
  .chat-popover.expanded{
    left:8px!important;
    right:8px!important;
    bottom:82px!important;
    top:auto!important;
    width:auto!important;
    height:calc(100dvh - 104px)!important;
    max-height:calc(100dvh - 104px)!important;
    min-width:0!important;
    min-height:0!important;
    transform:none!important;
    border-radius:20px!important;
  }
  .chat-popover-inner{padding:12px!important;gap:8px!important;}
  .chat-head{min-height:38px!important;}
  .chat-avatar{width:34px!important;height:34px!important;font-size:18px!important;}
  .chat-title{font-size:22px!important;}
  .chat-head-actions{padding-right:62px!important;}
  .chat-tabs{max-height:32px!important;}
  .chat-msgs{min-height:0!important;padding:11px!important;}
  .chat-bubble{max-width:94%!important;}
  .chat-quick-wrap{display:none!important;}
  .chat-quick-label{display:none!important;}
  .chat-admin-actions{gap:5px!important;}
  .chat-admin-actions .btn-out,
  .chat-admin-actions a.btn-out{height:32px!important;min-width:32px!important;padding:0 8px!important;font-size:10px!important;}
  .chat-fab{right:16px!important;bottom:18px!important;width:54px!important;height:54px!important;}
}

/* Reduce parpadeos visuales generales del chat */
.chat-popover *, .chat-fab *{
  animation-duration:.01ms!important;
  animation-iteration-count:1!important;
}


/* ======================================================================
   v33.14 — CRM estable / layout chat operador
   Objetivo: corregir botones fuera de marco, encabezado obstruido,
   maximizado con poco espacio útil y bandeja visible en PC.
   No toca Firebase ni lógica JS.
   ====================================================================== */
:root{
  --chat-v3314-w: min(650px, calc(100vw - 28px));
  --chat-v3314-w-tabs: min(860px, calc(100vw - 28px));
  --chat-v3314-expanded-w: min(1180px, calc(100vw - 36px));
  --chat-v3314-expanded-h: min(820px, calc(100dvh - 42px));
  --chat-v3314-sidebar: 210px;
  --chat-v3314-bottom: 84px;
}

/* Ventana general: más cómoda en PC, sin resize nativo ni saltos */
html body .chat-popover{
  width:var(--chat-v3314-w)!important;
  height:min(690px, calc(100dvh - 112px))!important;
  max-height:calc(100dvh - 112px)!important;
  right:22px!important;
  bottom:var(--chat-v3314-bottom)!important;
  left:auto!important;
  top:auto!important;
  resize:none!important;
  overflow:hidden!important;
  border-radius:22px!important;
}
html body .chat-popover:has(.chat-tabs){
  width:var(--chat-v3314-w-tabs)!important;
}
html body .chat-popover.expanded{
  width:var(--chat-v3314-expanded-w)!important;
  height:var(--chat-v3314-expanded-h)!important;
  max-width:calc(100vw - 36px)!important;
  max-height:calc(100dvh - 42px)!important;
  left:50%!important;
  right:auto!important;
  bottom:20px!important;
  top:auto!important;
  transform:translateX(-50%)!important;
  resize:none!important;
}

/* Estructura principal: si hay pestañas/chats abiertos, se convierten en bandeja lateral */
html body .chat-popover .chat-popover-inner{
  height:100%!important;
  max-height:none!important;
  overflow:hidden!important;
  padding:14px!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  gap:10px!important;
}
html body .chat-popover:has(.chat-tabs) .chat-popover-inner{
  grid-template-columns:var(--chat-v3314-sidebar) minmax(0,1fr)!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  column-gap:12px!important;
  row-gap:10px!important;
}
html body .chat-popover .chat-head{
  grid-column:1 / -1!important;
  grid-row:1!important;
  min-height:42px!important;
  max-height:none!important;
  margin:0!important;
  padding-right:78px!important;
  align-self:start!important;
  overflow:hidden!important;
}
html body .chat-popover:has(.chat-tabs) .chat-head{
  grid-column:2!important;
}
html body .chat-popover .chat-panel{
  grid-column:1 / -1!important;
  grid-row:2!important;
  min-height:0!important;
  height:100%!important;
  max-height:none!important;
  overflow:hidden!important;
  display:grid!important;
  grid-template-rows:minmax(0,1fr) auto auto auto!important;
  gap:8px!important;
}
html body .chat-popover:has(.chat-tabs) .chat-panel{
  grid-column:2!important;
  grid-row:2!important;
}

/* Bandeja lateral: visible por defecto en PC, compacta y con indicadores claros */
html body .chat-popover .chat-tabs{
  grid-column:1!important;
  grid-row:1 / 3!important;
  width:100%!important;
  max-width:none!important;
  height:100%!important;
  max-height:none!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:7px!important;
  margin:0!important;
  padding:8px!important;
  border:1px solid rgba(255,255,255,.08)!important;
  border-radius:18px!important;
  background:linear-gradient(180deg,rgba(255,255,255,.045),rgba(0,0,0,.12))!important;
  scrollbar-width:thin!important;
}
html body .chat-popover .chat-tabs::before{
  content:'Bandeja';
  display:block;
  color:var(--text3);
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.14em;
  font-weight:900;
  padding:2px 4px 4px;
}
html body .chat-popover .chat-tab{
  width:100%!important;
  max-width:none!important;
  min-height:40px!important;
  height:auto!important;
  border-radius:13px!important;
  justify-content:flex-start!important;
  padding:8px 9px!important;
  font-size:12px!important;
  background:#101010!important;
  border-color:rgba(255,255,255,.08)!important;
  color:var(--text2)!important;
  white-space:normal!important;
}
html body .chat-popover .chat-tab.active{
  background:rgba(232,0,10,.16)!important;
  border-color:rgba(232,0,10,.55)!important;
  color:#fff!important;
}
html body .chat-popover .chat-tab.unread{
  background:rgba(232,0,10,.20)!important;
  border-color:rgba(232,0,10,.75)!important;
  box-shadow:inset 4px 0 0 var(--red), 0 0 0 1px rgba(232,0,10,.10)!important;
  animation:none!important;
}
html body .chat-popover .chat-tab.unread::before{
  content:''!important;
  width:9px!important;
  height:9px!important;
  min-width:9px!important;
  border-radius:50%!important;
  background:var(--red)!important;
  box-shadow:0 0 0 5px rgba(232,0,10,.15),0 0 16px rgba(232,0,10,.65)!important;
}
html body .chat-popover .chat-tab-name{
  flex:1 1 auto!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
html body .chat-popover .chat-tab-close{
  flex:0 0 auto!important;
}

/* Mensajes: ocupan TODO el espacio útil disponible */
html body .chat-popover .chat-msgs,
html body .chat-popover.expanded .chat-msgs{
  grid-row:1!important;
  flex:none!important;
  min-height:0!important;
  height:100%!important;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:14px!important;
  border-radius:16px!important;
  scroll-behavior:auto!important;
}
html body .chat-popover .chat-bubble{
  max-width:88%!important;
  box-shadow:none!important;
}

/* Input y herramientas: siempre debajo, nunca encima del encabezado */
html body .chat-popover .chat-row{
  grid-row:2!important;
  flex:none!important;
  margin:0!important;
  min-height:50px!important;
  padding:5px!important;
  border-radius:18px!important;
}
html body .chat-popover .chat-admin-tools{
  grid-row:3!important;
  flex:none!important;
  margin:0!important;
  padding:0!important;
  display:flex!important;
  flex-wrap:wrap!important;
  gap:6px!important;
  max-height:36px!important;
  overflow:hidden!important;
}
html body .chat-popover .chat-filter,
html body .chat-popover .chat-clean-btn,
html body .chat-popover .chat-icon-btn{
  flex:0 0 auto!important;
}
html body .chat-popover .chat-tools-block,
html body .chat-popover.expanded .chat-tools-block{
  grid-row:4!important;
  flex:none!important;
  max-height:82px!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:0 2px 0 0!important;
  margin:0!important;
  border-top:1px solid rgba(255,255,255,.06)!important;
  padding-top:7px!important;
}
html body .chat-popover .chat-quick-wrap,
html body .chat-popover.expanded .chat-quick-wrap{
  display:flex!important;
  flex-wrap:wrap!important;
  overflow:visible!important;
  max-height:none!important;
  gap:5px!important;
  margin:0 0 6px 0!important;
  padding:0!important;
}
html body .chat-popover .chat-quick{
  height:28px!important;
  min-width:28px!important;
  width:auto!important;
  padding:0 8px!important;
  border-radius:999px!important;
  font-size:10.5px!important;
}
html body .chat-popover .chat-admin-actions,
html body .chat-popover.expanded .chat-admin-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:6px!important;
  overflow:visible!important;
  padding:0!important;
  margin:0!important;
  justify-content:flex-start!important;
  background:transparent!important;
  position:static!important;
}
html body .chat-popover .chat-admin-actions .btn-out,
html body .chat-popover .chat-admin-actions a.btn-out,
html body .chat-popover.expanded .chat-admin-actions .btn-out,
html body .chat-popover.expanded .chat-admin-actions a.btn-out{
  width:34px!important;
  min-width:34px!important;
  height:34px!important;
  padding:0!important;
  margin:0!important;
  border-radius:50%!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:0!important;
}
html body .chat-popover .chat-admin-actions .btn-out .ico,
html body .chat-popover .chat-admin-actions a.btn-out .ico{font-size:14px!important;}

/* Vista expandida: menos altura para herramientas, más para mensajes */
html body .chat-popover.expanded .chat-tools-block{max-height:74px!important;}
html body .chat-popover.expanded .chat-admin-tools{max-height:34px!important;}
html body .chat-popover.expanded .chat-row{min-height:48px!important;}

/* Bandeja principal: resalta chats sin leer cuando estás en la pantalla de bandeja */
html body .chat-list-item.unread{
  background:rgba(232,0,10,.15)!important;
  border-color:rgba(232,0,10,.72)!important;
  box-shadow:inset 4px 0 0 var(--red)!important;
}
html body .chat-list-item.unread .chat-status.new{
  background:var(--red)!important;
  color:#fff!important;
}
html body .chat-list-item:hover{transform:none!important;}

/* Mobile: no lateral fijo; bandeja/tabs arriba y chat ancho */
@media(max-width:700px){
  html body .chat-popover,
  html body .chat-popover:has(.chat-tabs),
  html body .chat-popover.expanded{
    left:8px!important;
    right:8px!important;
    bottom:82px!important;
    top:auto!important;
    width:auto!important;
    height:calc(100dvh - 104px)!important;
    max-height:calc(100dvh - 104px)!important;
    transform:none!important;
  }
  html body .chat-popover .chat-popover-inner,
  html body .chat-popover:has(.chat-tabs) .chat-popover-inner{
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:auto auto minmax(0,1fr)!important;
    padding:11px!important;
    gap:8px!important;
  }
  html body .chat-popover .chat-tabs{
    grid-column:1!important;
    grid-row:1!important;
    height:auto!important;
    max-height:56px!important;
    flex-direction:row!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    padding:6px!important;
    border-radius:14px!important;
  }
  html body .chat-popover .chat-tabs::before{display:none!important;}
  html body .chat-popover .chat-tab{
    width:auto!important;
    min-width:112px!important;
    max-width:160px!important;
    min-height:36px!important;
    padding:7px 9px!important;
  }
  html body .chat-popover .chat-head,
  html body .chat-popover:has(.chat-tabs) .chat-head{
    grid-column:1!important;
    grid-row:2!important;
    padding-right:66px!important;
  }
  html body .chat-popover .chat-panel,
  html body .chat-popover:has(.chat-tabs) .chat-panel{
    grid-column:1!important;
    grid-row:3!important;
    grid-template-rows:minmax(0,1fr) auto auto!important;
  }
  html body .chat-popover .chat-tools-block,
  html body .chat-popover.expanded .chat-tools-block{
    max-height:62px!important;
  }
  html body .chat-popover .chat-admin-tools{max-height:32px!important;}
  html body .chat-popover .chat-quick-wrap{display:none!important;}
  html body .chat-popover .chat-admin-actions .btn-out,
  html body .chat-popover .chat-admin-actions a.btn-out{width:32px!important;min-width:32px!important;height:32px!important;}
}


/* ======================================================================
   v33.15 — Bandeja inteligente
   - Bandeja visible por defecto en PC cuando se abre una conversación.
   - Indicadores claros: esperando, prioridad, online, al día.
   - No toca Firebase ni listeners principales.
   ====================================================================== */
html body .chat-popover:has(.chat-inbox-side){
  width:min(940px, calc(100vw - 28px))!important;
}
html body .chat-popover.expanded:has(.chat-inbox-side){
  width:min(1220px, calc(100vw - 36px))!important;
}
html body .chat-inbox-side{
  padding:9px!important;
  gap:8px!important;
}
html body .chat-inbox-side::before{
  content:'Bandeja · actividad';
  display:flex!important;
  align-items:center;
  justify-content:space-between;
  color:var(--text3);
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.12em;
  font-weight:900;
  padding:2px 4px 5px;
}
html body .chat-inbox-side .chat-tab{
  display:grid!important;
  grid-template-columns:12px minmax(0,1fr) 18px!important;
  align-items:center!important;
  column-gap:8px!important;
  min-height:58px!important;
  padding:8px!important;
  text-align:left!important;
}
html body .chat-tab-light{
  width:10px!important;
  height:10px!important;
  border-radius:50%!important;
  display:block!important;
  background:#4b5563!important;
  box-shadow:0 0 0 4px rgba(255,255,255,.04)!important;
}
html body .chat-tab.waiting .chat-tab-light,
html body .chat-tab.unread .chat-tab-light{
  background:var(--red)!important;
  box-shadow:0 0 0 5px rgba(232,0,10,.16),0 0 18px rgba(232,0,10,.75)!important;
}
html body .chat-tab.priority .chat-tab-light{
  background:#f5c842!important;
  box-shadow:0 0 0 5px rgba(245,200,66,.13),0 0 18px rgba(245,200,66,.65)!important;
}
html body .chat-tab.online:not(.waiting):not(.priority) .chat-tab-light{
  background:#4caf7d!important;
  box-shadow:0 0 0 5px rgba(76,175,125,.13),0 0 16px rgba(76,175,125,.6)!important;
}
html body .chat-tab-body{
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
  gap:2px!important;
}
html body .chat-inbox-side .chat-tab-name{
  font-size:12.5px!important;
  font-weight:900!important;
  color:#fff!important;
  line-height:1.1!important;
}
html body .chat-tab-preview,
html body .chat-tab-foot{
  display:block!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
html body .chat-tab-preview{
  color:var(--text2)!important;
  font-size:10.5px!important;
  line-height:1.15!important;
}
html body .chat-tab-foot{
  color:var(--text3)!important;
  font-size:9.5px!important;
  line-height:1.1!important;
  text-transform:uppercase!important;
  letter-spacing:.04em!important;
  font-weight:800!important;
}
html body .chat-tab.waiting,
html body .chat-tab.unread{
  background:rgba(232,0,10,.18)!important;
  border-color:rgba(232,0,10,.72)!important;
  box-shadow:inset 4px 0 0 var(--red)!important;
}
html body .chat-tab.priority:not(.unread){
  background:rgba(245,200,66,.08)!important;
  border-color:rgba(245,200,66,.35)!important;
  box-shadow:inset 4px 0 0 #f5c842!important;
}
html body .chat-tab.answered:not(.active):not(.online){
  opacity:.82!important;
}
html body .chat-tab.active{
  opacity:1!important;
  outline:1px solid rgba(255,255,255,.12)!important;
}
html body .chat-tab-close{
  justify-self:end!important;
}
/* En la pantalla principal de bandeja, reforzar lectura rápida */
html body .chat-list-item.unread,
html body .chat-list-item.priority{
  background:rgba(232,0,10,.14)!important;
  border-color:rgba(232,0,10,.66)!important;
}
html body .chat-list-item.unread .chat-list-title,
html body .chat-list-item.priority .chat-list-title{
  color:#fff!important;
  font-weight:900!important;
}
@media(max-width:700px){
  html body .chat-popover:has(.chat-inbox-side){width:auto!important;}
  html body .chat-inbox-side{
    max-height:62px!important;
    min-height:0!important;
    flex-direction:row!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    padding:6px!important;
  }
  html body .chat-inbox-side::before{display:none!important;}
  html body .chat-inbox-side .chat-tab{
    grid-template-columns:10px minmax(88px,1fr) 16px!important;
    min-width:138px!important;
    max-width:176px!important;
    min-height:42px!important;
  }
  html body .chat-tab-preview{display:none!important;}
}



/* ======================================================================
   v33.17 — Corrección botones/header en maximizado + ADM logout
   - Botoneras no se tapan en pantalla expandida.
   - Respuestas rápidas sin doble icono.
   - Header protegido y bandeja fija.
   ====================================================================== */
html body .chat-popover.expanded:has(.chat-inbox-side) .chat-popover-inner{
  grid-template-columns:250px minmax(0,1fr)!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  padding:14px!important;
  gap:12px!important;
}
html body .chat-popover.expanded .chat-head{
  min-width:0!important;
  overflow:hidden!important;
  padding-right:76px!important;
  z-index:2!important;
}
html body .chat-popover.expanded .chat-title,
html body .chat-popover.expanded .chat-subline{
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
html body .chat-popover.expanded .chat-panel{
  min-width:0!important;
  min-height:0!important;
  overflow:hidden!important;
  display:grid!important;
  grid-template-rows:minmax(0,1fr) 50px 38px 92px!important;
  gap:8px!important;
}
html body .chat-popover.expanded .chat-msgs{
  min-height:0!important;
  height:100%!important;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:14px!important;
}
html body .chat-popover.expanded .chat-row{
  min-height:0!important;
  height:50px!important;
}
html body .chat-popover.expanded .chat-admin-tools{
  min-height:0!important;
  height:38px!important;
  max-height:38px!important;
  align-content:center!important;
  overflow:hidden!important;
}
html body .chat-popover.expanded .chat-tools-block{
  min-height:0!important;
  height:92px!important;
  max-height:92px!important;
  overflow:hidden!important;
  border-top:1px solid rgba(255,255,255,.06)!important;
  padding-top:7px!important;
}
html body .chat-popover.expanded .chat-quick-label{
  display:block!important;
  height:13px!important;
  line-height:13px!important;
  margin:0 0 4px 0!important;
  overflow:hidden!important;
}
html body .chat-popover.expanded .chat-quick-wrap{
  display:flex!important;
  flex-wrap:nowrap!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  height:32px!important;
  max-height:32px!important;
  gap:6px!important;
  margin:0 0 6px 0!important;
  padding:0 0 2px 0!important;
  scrollbar-width:thin!important;
}
html body .chat-popover.expanded .chat-quick{
  flex:0 0 auto!important;
  height:28px!important;
  min-width:28px!important;
  max-width:150px!important;
  padding:0 9px!important;
  white-space:nowrap!important;
}
html body .chat-popover.expanded .chat-quick .qr-ico{margin-right:5px!important;}
html body .chat-popover.expanded .chat-quick .qr-text{
  display:inline!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
html body .chat-popover.expanded .chat-admin-actions{
  display:flex!important;
  flex-wrap:nowrap!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  height:36px!important;
  max-height:36px!important;
  gap:6px!important;
  padding:0 2px 2px 0!important;
  scrollbar-width:thin!important;
}
html body .chat-popover.expanded .chat-admin-actions .btn-out,
html body .chat-popover.expanded .chat-admin-actions a.btn-out{
  flex:0 0 34px!important;
  width:34px!important;
  min-width:34px!important;
  height:34px!important;
  max-height:34px!important;
  padding:0!important;
  border-radius:50%!important;
}
html body .chat-popover.expanded .chat-inbox-side,
html body .chat-popover.expanded .chat-tabs{
  min-width:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
html body .chat-tab-body,
html body .chat-tab-name,
html body .chat-tab-preview,
html body .chat-tab-foot{
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
html body .admin-live-indicator{cursor:pointer!important;}

@media(max-width:700px){
  html body .chat-popover.expanded .chat-panel,
  html body .chat-popover .chat-panel{
    grid-template-rows:minmax(0,1fr) 48px 36px 54px!important;
  }
  html body .chat-popover.expanded .chat-tools-block,
  html body .chat-popover .chat-tools-block{
    height:54px!important;
    max-height:54px!important;
  }
  html body .chat-popover .chat-quick-label,
  html body .chat-popover .chat-quick-wrap{display:none!important;}
}



/* =====================================================================
   v33.18 — Toolbar unificada + Resumen WA visible + ajustes overflow
   Objetivo: en pantalla expandida todos los botones quedan en un solo
   renglón inferior, sin taparse. También corrige doble icono visual.
   ===================================================================== */
html body .chat-popover.expanded .chat-panel{
  grid-template-rows:minmax(0,1fr) 50px 38px 46px!important;
  gap:8px!important;
}
html body .chat-popover.expanded .chat-tools-block{
  height:46px!important;
  max-height:46px!important;
  min-height:46px!important;
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  padding:5px 4px 5px 0!important;
  border-top:1px solid rgba(255,255,255,.06)!important;
  scrollbar-width:thin!important;
}
html body .chat-popover.expanded .chat-tools-block::-webkit-scrollbar{height:5px!important;}
html body .chat-popover.expanded .chat-tools-block::-webkit-scrollbar-track{background:#080808!important;border-radius:999px!important;}
html body .chat-popover.expanded .chat-tools-block::-webkit-scrollbar-thumb{background:var(--red)!important;border-radius:999px!important;}
html body .chat-popover.expanded .chat-quick-label{display:none!important;}
html body .chat-popover.expanded .chat-quick-wrap,
html body .chat-popover.expanded .chat-admin-actions{
  flex:0 0 auto!important;
  width:auto!important;
  max-width:none!important;
  height:36px!important;
  max-height:36px!important;
  min-height:36px!important;
  display:flex!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  gap:6px!important;
  padding:0!important;
  margin:0!important;
  overflow:visible!important;
}
html body .chat-popover.expanded .chat-quick,
html body .chat-popover.expanded .chat-admin-actions .btn-out,
html body .chat-popover.expanded .chat-admin-actions a.btn-out{
  flex:0 0 auto!important;
  width:auto!important;
  min-width:34px!important;
  max-width:none!important;
  height:34px!important;
  min-height:34px!important;
  padding:0 10px!important;
  border-radius:999px!important;
  font-size:11px!important;
  line-height:1!important;
  white-space:nowrap!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
html body .chat-popover.expanded .chat-admin-actions .btn-out .ico,
html body .chat-popover.expanded .chat-admin-actions a.btn-out .ico{
  font-size:15px!important;
  line-height:1!important;
}
html body .chat-popover.expanded .chat-admin-actions .btn-out[data-action="resumen-wa"]{
  min-width:112px!important;
  color:#fff!important;
  border-color:rgba(37,211,102,.45)!important;
  background:rgba(37,211,102,.10)!important;
}
html body .chat-popover.expanded .chat-admin-actions .btn-out[data-action="resumen-wa"]::after{
  content:' Resumen WA';
  font-size:10px;
  font-weight:900;
  margin-left:5px;
}
html body .chat-popover.expanded .chat-msgs{
  min-height:0!important;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
html body .chat-popover.expanded .chat-row{height:50px!important;min-height:50px!important;}
html body .chat-popover.expanded .chat-admin-tools{height:38px!important;min-height:38px!important;max-height:38px!important;}
html body .chat-popover .chat-quick .qr-text{
  max-width:110px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
html body .chat-popover .chat-quick .qr-ico + .qr-text:empty{display:none!important;}
@media(max-width:700px){
  html body .chat-popover.expanded .chat-panel,
  html body .chat-popover .chat-panel{grid-template-rows:minmax(0,1fr) 48px 36px 40px!important;}
  html body .chat-popover.expanded .chat-tools-block,
  html body .chat-popover .chat-tools-block{height:40px!important;max-height:40px!important;overflow-x:auto!important;display:flex!important;}
  html body .chat-popover .chat-quick-wrap{display:none!important;}
  html body .chat-popover .chat-admin-actions{display:flex!important;flex-wrap:nowrap!important;overflow:visible!important;height:34px!important;}
  html body .chat-popover .chat-admin-actions .btn-out,
  html body .chat-popover .chat-admin-actions a.btn-out{min-width:32px!important;height:32px!important;padding:0 8px!important;}
}
