:root{
  --blue:#0a8fd8; --blue-d:#0877b8; --blue-l:#e6f4fc;
  --teal:#14b8a6; --orange:#f26b1d; --green:#18b26a; --purple:#8b5cf6; --red:#ef4444;
  --bg:#eef7fb; --card:#fff; --text:#14324a; --muted:#7b8fa1; --line:#e3edf3;
  --radius:12px; --shadow:0 2px 10px rgba(10,90,140,.08);
}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:"Nunito","Poppins","Segoe UI",system-ui,sans-serif;background:var(--bg);color:var(--text);font-size:17px;line-height:1.35}
a{color:inherit;text-decoration:none}
button,input,select{font:inherit;color:inherit}
svg.i{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}

/* ---------- Layout ---------- */
.app{display:grid;grid-template-columns:225px 1fr;min-height:100vh}
.sidebar{background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column}
.brand{background:linear-gradient(135deg,#0a8fd8,#0e6fb0);color:#fff;display:flex;align-items:center;gap:8px;padding:14px 12px;height:64px}
.brand svg{width:34px;height:34px}
.brand b{display:block;font-size:17px;font-weight:800;line-height:1.1}
.brand small{display:block;font-size:11px;font-style:italic;opacity:.9}
.nav{padding:12px 10px;display:flex;flex-direction:column;gap:2px;flex:1}
.nav a{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:8px;color:#26465f;font-weight:600;font-size:16px}
.nav a:hover{background:var(--blue-l)}
.nav a.active{background:var(--blue);color:#fff}
.nav .chev{margin-left:auto;width:12px;height:12px}
.nav .sub{display:flex;flex-direction:column;gap:2px;padding-left:24px}
.nav .sub a{font-size:14px;padding:7px 12px;font-weight:600;color:#43637c}
.nav .sub a.active{background:var(--blue-l);color:var(--blue-d)}
.side-foot{padding:12px 14px 16px;display:flex;flex-direction:column;gap:12px;font-size:13px;color:#43637c}
.side-foot a{display:flex;gap:8px;align-items:center}
.main{display:flex;flex-direction:column;min-width:0}
.topbar{height:64px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:flex-end;padding:0 24px}
.user{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:700}
.user .av{width:24px;height:24px;border-radius:50%;background:linear-gradient(135deg,#0a8fd8,#14b8a6);color:#fff;display:grid;place-items:center;font-size:12px}
.content{padding:20px 24px 32px;flex:1}
.page-head{display:flex;align-items:flex-start;gap:10px;margin-bottom:16px}
.page-head .back{color:var(--blue);margin-top:3px}
.page-head h1{font-size:22px;font-weight:800;line-height:1.1}
.page-head p{font-size:13px;color:var(--muted);margin-top:2px}
.page-head .right{margin-left:auto;display:flex;gap:10px;align-items:center}

/* ---------- Componentes ---------- */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:0;border-radius:8px;padding:9px 16px;font-weight:700;font-size:14px;cursor:pointer;background:var(--blue);color:#fff}
.btn.orange{background:var(--orange)} .btn.teal{background:var(--teal)}
.btn.ghost{background:#fff;color:var(--blue-d);border:1px solid var(--line)}
.btn.pill{border-radius:20px}
.btn.block{width:100%}
.field{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted);font-weight:700}
.input,.select{border:1px solid var(--line);background:#fff;border-radius:8px;padding:8px 10px;font-size:14px;width:100%}
.date{display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--line);background:#fff;border-radius:8px;padding:8px 10px;font-size:13px;min-width:190px}

.stats{display:grid;gap:12px;grid-template-columns:repeat(4,1fr)}
.stat{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px}
.stat .ic{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;flex:none}
.stat .ic svg{width:16px;height:16px}
.stat small{display:block;font-size:12px;color:var(--muted);font-weight:700}
.stat strong{font-size:22px;font-weight:800;line-height:1.1}
.c-green{background:#dcf7ea;color:var(--green)} .c-blue{background:#dff1fb;color:var(--blue)}
.c-orange{background:#ffe9db;color:var(--orange)} .c-purple{background:#ece6ff;color:var(--purple)}
.c-teal{background:#d5f5f1;color:var(--teal)} .c-red{background:#fde2e2;color:var(--red)}

.bar{height:6px;border-radius:6px;background:#e7f0f5;overflow:hidden}
.bar>i{display:block;height:100%;border-radius:6px;background:linear-gradient(90deg,var(--green),#4bd68f)}
.bar.blue>i{background:linear-gradient(90deg,var(--blue),#37b3f0)}

.ring{--v:78;width:56px;height:56px;border-radius:50%;background:conic-gradient(var(--green) calc(var(--v)*1%),#e3eef4 0);display:grid;place-items:center;flex:none}
.ring span{width:42px;height:42px;border-radius:50%;background:#fff;display:grid;place-items:center;font-weight:800;font-size:16px}
.donut{--v:72;width:130px;height:130px;border-radius:50%;background:conic-gradient(var(--green) calc(var(--v)*1%),var(--orange) 0);display:grid;place-items:center;flex:none}
.donut span{width:88px;height:88px;border-radius:50%;background:#fff;display:grid;place-items:center;font-weight:800;font-size:24px}

table{width:100%;border-collapse:collapse;font-size:13px}
th{text-align:left;color:var(--muted);font-weight:700;padding:8px 10px;border-bottom:1px solid var(--line);font-size:12px}
td{padding:8px 10px;border-bottom:1px solid #f0f5f8}
tr:last-child td{border-bottom:0}
.tag-ok{color:var(--green)} .dot-ok,.dot-warn{display:inline-grid;place-items:center;width:17px;height:17px;border-radius:50%;color:#fff;font-size:11px}
.dot-ok{background:var(--green)} .dot-warn{background:var(--orange)}
.badge{display:inline-block;padding:4px 12px;border-radius:14px;font-size:12px;font-weight:800}
.badge.done{background:#dcf7ea;color:var(--green)} .badge.prog{background:#ffe9db;color:var(--orange)} .badge.pend{background:#fde2e2;color:var(--red)}
.tabs{display:flex;gap:6px;margin-bottom:14px}
.tabs a,.tabs button{border:1px solid var(--line);background:#fff;border-radius:6px;padding:7px 18px;font-size:13px;font-weight:700;color:#43637c;cursor:pointer}
.tabs .on{background:var(--blue);border-color:var(--blue);color:#fff}
.avatar{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;font-size:22px;flex:none;border:2px solid #fff;box-shadow:0 0 0 2px #cfe6f3}
.av-a{background:#ffd9a8}.av-b{background:#bfe3ff}.av-c{background:#ffc9d6}.av-d{background:#cdeedb}.av-e{background:#e4d6ff}.av-f{background:#ffe9a0}

/* ---------- Login ---------- */
.login{min-height:100vh;display:grid;grid-template-columns:420px 1fr;background:linear-gradient(135deg,#dff3fb,#bfe6f5);position:relative;overflow:hidden}
.login::before{content:"";position:absolute;inset:0;pointer-events:none;}
.login .corner{position:absolute;z-index:1;pointer-events:none;height:auto}
.login .c-tl{top:0;left:0;width:clamp(150px,22vw,330px)}
.login .c-tr{top:0;right:0;width:clamp(150px,21vw,320px)}
.login .c-bl{bottom:0;left:0;width:clamp(90px,12vw,170px)}
.login .c-br{bottom:0;right:0;width:clamp(200px,34vw,520px)}
.login-card{background:#fff;margin:auto 0 auto 40px;width:340px;border-radius:18px;padding:32px 28px;box-shadow:0 14px 40px rgba(10,90,140,.18);position:relative;z-index:2}
.login-card .logo { display: flex; gap: 10px; align-items: center; justify-content: center; margin-bottom: 26px; margin-left: auto; margin-right: auto; width: fit-content; }
.login-card .logo img, .login-card .logo svg { width: 200px; height: auto; }
.login-card h2{font-size:19px;margin-bottom:14px}
.login-card .input{padding:11px 12px;margin-bottom:12px;background:#f7fbfd}
.login-card .link{display:block;text-align:center;font-size:12px;color:var(--blue);margin-top:14px}
.login-card .url{font-size:12px;font-weight:700;color:var(--blue-d);margin-top:36px}
.login-art{position:relative;z-index:2;display:flex;align-items:center;justify-content:center;font-size:140px;gap:10px}

/* ---------- Inicio ---------- */
.hero{background:linear-gradient(120deg,#e6f6fd,#c9ecf8);border-radius:14px;padding:26px 28px;position:relative;overflow:hidden;margin-bottom:16px;min-height:120px}
.hero small{font-size:16px;font-weight:700;display:block}
.hero h1{font-size:31px;color:var(--blue-d);font-weight:800;line-height:1.1}
.hero p{font-size:16px;margin-top:4px}
.hero .deco{position:absolute;right:30px;top:6px;font-size:90px;transform:rotate(15deg);opacity:.9}
.tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:14px}
.tile{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:16px;box-shadow:var(--shadow)}
.tile .ic{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;margin-bottom:8px;color:#fff}
.tile h3{font-size:17px;margin-bottom:4px}
.tile p{font-size:13px;color:var(--muted);margin-bottom:12px;min-height:30px}
.tile .btn{width:100%;border-radius:6px}

/* ---------- Tareas ---------- */
.filters{display:grid;grid-template-columns:200px 200px;gap:12px;margin-bottom:12px}
.summary{display:grid;grid-template-columns:1.2fr repeat(3,1fr);gap:12px;margin-bottom:16px}
.summary .big{display:flex;align-items:center;gap:12px}
.summary .big .ring{width:60px;height:60px}.summary .big .ring span{width:46px;height:46px}
.group-row td{background:#f6fafc;font-weight:800}
.ico-sq{display:inline-grid;place-items:center;width:16px;height:16px;border-radius:4px;font-size:12px;margin-right:6px;vertical-align:middle}

/* ---------- Alumnos ---------- */
.search-row{display:grid;grid-template-columns:1fr 200px;gap:12px;margin-bottom:14px}
.kids{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.kid{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px;box-shadow:var(--shadow)}
.kid .top{display:flex;gap:10px;align-items:center;margin-bottom:10px}
.kid .top b{font-size:14px;display:block}.kid .top small{font-size:12px;color:var(--muted)}
.kid .top .more{margin-left:auto;color:var(--muted)}
.kid .row{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);margin-bottom:4px}
.kid .row b{color:var(--text)}
.kid .meta{display:flex;justify-content:space-between;margin:10px 0 8px;font-size:13px}
.kid .meta span{display:flex;gap:6px;align-items:center}
.kid .meta small{display:block;color:var(--muted);font-size:11px}
.kid .btn{width:100%;justify-content:space-between;background:#fff;color:var(--blue-d);border:1px solid var(--line);padding:6px 10px;font-size:13px}

/* ---------- Perfil alumno ---------- */
.profile-head{display:flex;gap:14px;align-items:center;margin-bottom:14px}
.profile-head .avatar{width:56px;height:56px;font-size:32px}
.profile-head h2{font-size:19px}.profile-head small{color:var(--muted);font-size:13px}
.profile-head .btn{margin-left:auto}
.mini-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:14px}

/* ---------- Informes ---------- */
.charts{display:grid;grid-template-columns:1.6fr 1fr;gap:14px;margin:14px 0}
.chart-title{font-size:14px;font-weight:800;margin-bottom:10px}
.legend{display:flex;flex-direction:column;gap:10px;font-size:13px}
.legend i{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:6px}
.hbars{display:flex;flex-direction:column;gap:10px}
.hbars .r{display:grid;grid-template-columns:115px 1fr 42px;gap:10px;align-items:center;font-size:13px}
.hbars .bar{height:8px}

/* ---------- Clase ---------- */
.lessons{display:flex;flex-direction:column;gap:12px}
.lesson{display:flex;align-items:center;gap:14px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:10px 16px 10px 10px;box-shadow:var(--shadow)}
.lesson .thumb{width:70px;height:50px;border-radius:8px;display:grid;place-items:center;font-size:28px;background:linear-gradient(135deg,#ffd36b,#ff9f43)}
.lesson .thumb.t2{background:linear-gradient(135deg,#7fd1f5,#3fa9e0)}
.lesson .thumb.t3{background:linear-gradient(135deg,#ffe58a,#f6b93b)}
.lesson b{font-size:14px;display:block}.lesson small{font-size:12px;color:var(--muted)}
.lesson .info{flex:1}.lesson .arrow{color:var(--muted)}

/* ---------- Chat ---------- */
.chat{display:grid;grid-template-columns:275px 1fr;gap:14px;height:calc(100vh - 190px);min-height:460px}
.convs{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:12px;overflow:auto}
.convs h4{font-size:13px;margin-bottom:10px;display:flex;justify-content:space-between}
.conv{display:flex;gap:8px;align-items:center;padding:8px;border-radius:8px;cursor:pointer}
.conv.on{background:var(--blue-l)}
.conv .avatar{width:32px;height:32px;font-size:18px}
.conv b{font-size:13px;display:block}.conv small{font-size:11px;color:var(--muted)}
.conv .t{margin-left:auto;font-size:11px;color:var(--muted);text-align:right}
.conv .n{display:inline-grid;place-items:center;width:14px;height:14px;border-radius:50%;background:var(--blue);color:#fff;font-size:10px;margin-top:2px}
.room{background:#fff;border:1px solid var(--line);border-radius:var(--radius);display:flex;flex-direction:column;overflow:hidden}
.room-head{padding:12px 16px;border-bottom:1px solid var(--line);display:flex;gap:10px;align-items:center}
.room-head b{font-size:14px;display:block}.room-head small{font-size:12px;color:var(--muted)}
.msgs{flex:1;padding:16px;overflow:auto;display:flex;flex-direction:column;gap:12px;background:#fbfdfe}
.msg{max-width:60%;display:flex;gap:8px;align-items:flex-end}
.msg .bubble{padding:9px 13px;border-radius:12px;font-size:13px;background:#eef3f6}
.msg .bubble small{display:block;text-align:right;font-size:11px;opacity:.7;margin-top:2px}
.msg.me{align-self:flex-end}
.msg.me .bubble{background:var(--blue);color:#fff;border-bottom-right-radius:3px}
.msg .who{font-size:11px;color:var(--muted);display:block;margin-bottom:2px}
.composer{display:flex;gap:8px;padding:12px;border-top:1px solid var(--line)}
.composer .input{flex:1;border-radius:20px}
.composer .send{width:34px;height:34px;border-radius:50%;border:0;background:var(--blue);color:#fff;cursor:pointer}


/* ===== Iconos y menú plegable ===== */
.nav a svg.i{width:17px;height:17px}
.nav a.active{--ck:var(--blue)}
.nav a.toggle .chev{transition:transform .2s}
.nav a.toggle.closed .chev{transform:rotate(-90deg)}
.nav .sub{overflow:hidden;max-height:170px;transition:max-height .25s ease,opacity .2s}
.nav .sub.collapsed{max-height:0;opacity:0;pointer-events:none}
.stat .ic svg.i{width:17px;height:17px}
.tile .ic svg.i{width:19px;height:19px}
.date svg.i{width:15px;height:15px;color:var(--muted)}
.page-head .back svg.i{width:18px;height:18px}
.btn svg.i{width:14px;height:14px}
.kid .meta svg.i{width:16px;height:16px;color:var(--blue)}
.composer .send{display:grid;place-items:center}
.composer .send svg.i{width:16px;height:16px;color:#fff}
.side-foot svg.i{width:15px;height:15px}
.input.ic-user,.input.ic-pass,.input.ic-search{padding-left:36px;background-repeat:no-repeat;background-size:16px;background-position:12px center}
.input.ic-user{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a8fd8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 3.5-6 8-6s8 2 8 6'/%3E%3C/svg%3E")}
.input.ic-pass{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a8fd8' stroke-width='2' stroke-linecap='round'%3E%3Crect x='4' y='10' width='16' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 018 0v3'/%3E%3C/svg%3E"),url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8fa1' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");background-position:12px center,right 12px center;background-size:16px,16px}
.input.ic-search{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8fa1' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E")}

/* ===== Botones con degradado ===== */
.btn{background:linear-gradient(135deg,#2db4f0 0%,#0a8fd8 55%,#0774b8 100%);box-shadow:0 2px 6px rgba(10,120,190,.28),inset 0 1px 0 rgba(255,255,255,.28);transition:filter .15s,transform .1s}
.btn.teal{background:linear-gradient(135deg,#3fd9b9 0%,#14b8a6 55%,#0d9488 100%);box-shadow:0 2px 6px rgba(20,160,140,.28),inset 0 1px 0 rgba(255,255,255,.28)}
.btn.orange{background:linear-gradient(135deg,#ff9a52 0%,#f26b1d 55%,#e0530a 100%);box-shadow:0 2px 6px rgba(240,100,30,.3),inset 0 1px 0 rgba(255,255,255,.28)}
.btn:hover{filter:brightness(1.07)}
.btn:active{transform:translateY(1px)}
.btn.ghost,.kid .btn{background:#fff;box-shadow:none}
.nav a.active{background:linear-gradient(135deg,#2db4f0 0%,#0a8fd8 60%,#0877b8 100%);box-shadow:0 2px 6px rgba(10,120,190,.25)}
.tabs .on{background:linear-gradient(135deg,#2db4f0,#0a8fd8 60%,#0877b8);box-shadow:0 2px 5px rgba(10,120,190,.25)}
.composer .send{background:linear-gradient(135deg,#2db4f0,#0a8fd8 60%,#0877b8)}
.msg.me .bubble{background:linear-gradient(135deg,#2db4f0,#0a8fd8 70%,#0877b8)}
.tile .ic{box-shadow:0 2px 6px rgba(0,0,0,.15)}

/* ===== Equipo ===== */
.team-grid{display:grid;grid-template-columns:260px 1fr;gap:20px;align-items:start}
.logo-drop{display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center}
.logo-box{width:150px;height:150px;border-radius:50%;border:2px dashed #b9d9ea;background:#f4fafd;display:grid;place-items:center;overflow:hidden;cursor:pointer;color:var(--blue);transition:border-color .15s,background .15s}
.logo-box:hover{border-color:var(--blue);background:var(--blue-l)}
.logo-box img{width:100%;height:100%;object-fit:cover}
.logo-box .ph{display:flex;flex-direction:column;align-items:center;gap:6px;font-size:13px;font-weight:700}
.logo-box .ph svg.i{width:34px;height:34px}
.logo-drop small{font-size:12px;color:var(--muted)}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.form-grid .full{grid-column:1/-1}
.field{font-size:13px}
.field .input{font-size:15px;padding:11px 12px}
.section-title{display:flex;align-items:center;gap:10px;margin:22px 0 12px}
.section-title h2{font-size:19px;font-weight:800}
.section-title .count{background:var(--blue-l);color:var(--blue-d);border-radius:14px;padding:3px 12px;font-size:13px;font-weight:800}
.section-title .btn{margin-left:auto}
.players{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.player{position:relative;display:flex;gap:14px;align-items:center;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px;box-shadow:var(--shadow)}
.photo{width:86px;height:86px;border-radius:50%;flex:none;border:2px dashed #b9d9ea;background:#f4fafd;display:grid;place-items:center;overflow:hidden;cursor:pointer;color:var(--blue)}
.photo:hover{border-color:var(--blue)}
.photo img{width:100%;height:100%;object-fit:cover}
.photo svg.i{width:28px;height:28px}
.pf{flex:1;display:flex;flex-direction:column;gap:10px;min-width:0}
.pf .two{display:grid;grid-template-columns:90px 1fr;gap:10px}
.player .rm{position:absolute;top:8px;right:8px;width:28px;height:28px;border-radius:50%;border:0;background:#fdecec;color:var(--red);cursor:pointer;display:grid;place-items:center}
.player .rm:hover{background:#fbd5d5}
.player .rm svg.i{width:15px;height:15px}
.input.err{border-color:var(--red);background:#fff6f6}
.empty{grid-column:1/-1;text-align:center;color:var(--muted);padding:34px;border:2px dashed #cfe3ee;border-radius:var(--radius);background:#fafdff;font-size:15px}
.actions{display:flex;gap:12px;justify-content:flex-end;margin-top:22px;align-items:center}
.actions .msg-err{color:var(--red);font-size:14px;font-weight:700;margin-right:auto}
.toast{position:fixed;right:24px;bottom:24px;background:#0f3a57;color:#fff;padding:12px 18px;border-radius:10px;font-weight:700;font-size:15px;box-shadow:0 8px 24px rgba(0,0,0,.2);opacity:0;transform:translateY(10px);transition:.25s;pointer-events:none;z-index:50}
.toast.show{opacity:1;transform:none}

/* ===================================================================
   RESPONSIVE — escritorio > 1100 · tablet ≤ 1100 · móvil ≤ 900 / 700 / 420
   =================================================================== */
html{-webkit-text-size-adjust:100%}
body{overflow-x:hidden}
img{max-width:100%}
.menu-btn,.drawer-close,.top-title,.scrim{display:none}
.topbar{position:sticky;top:0;z-index:30}
.page-head{flex-wrap:wrap}
.tabs{overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tabs a,.tabs button{white-space:nowrap}
.card div[style*="display:flex"]{flex-wrap:wrap}
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.table-wrap table{min-width:560px}

/* ---------- Tablet ---------- */
@media (max-width:1100px){
  .stats,.mini-stats{grid-template-columns:repeat(2,1fr)}
  .summary{grid-template-columns:repeat(2,1fr)}
  .summary .big{grid-column:1/-1}
  .charts,.charts[style]{grid-template-columns:1fr !important}
  .team-grid{grid-template-columns:1fr}
}

/* ---------- Móvil grande / tablet vertical: menú desplegable ---------- */
@media (max-width:900px){
  .app{grid-template-columns:1fr}
  .sidebar{position:fixed;top:0;left:0;bottom:0;width:min(290px,84vw);height:100vh;height:100dvh;z-index:100;transform:translateX(-102%);transition:transform .25s ease;overflow-y:auto}
  body.nav-open .sidebar{transform:none;box-shadow:0 0 40px rgba(0,0,0,.3)}
  .scrim{display:block;position:fixed;inset:0;background:rgba(10,40,60,.45);opacity:0;pointer-events:none;transition:opacity .25s;z-index:90}
  body.nav-open .scrim{opacity:1;pointer-events:auto}
  body.nav-open{overflow:hidden}
  .drawer-close{display:grid;place-items:center;margin-left:auto;width:36px;height:36px;border:0;border-radius:8px;background:rgba(255,255,255,.2);color:#fff;cursor:pointer}
  .drawer-close svg.i{width:18px;height:18px}
  .menu-btn{display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:10px;background:var(--blue-l);color:var(--blue-d);cursor:pointer;flex:none}
  .menu-btn svg.i{width:22px;height:22px}
  .top-title{display:block;flex:1;min-width:0;margin-left:10px;font-weight:800;color:var(--blue-d);font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .topbar{justify-content:flex-start;padding:0 14px}
  .user{font-size:13px;white-space:nowrap}
  .players,.form-grid{grid-template-columns:1fr}
  .chat{grid-template-columns:1fr;height:auto}
  .convs{display:flex;gap:8px;overflow-x:auto;padding:10px}
  .convs h4{display:none}
  .conv{min-width:220px;border:1px solid var(--line)}
  .room{height:calc(100vh - 340px);height:calc(100dvh - 340px);min-height:420px}
  .filters{grid-template-columns:1fr 1fr}
  .login{grid-template-columns:1fr;place-items:center;padding:24px 0}
  .login-art{display:none}
  .login .c-tl{width:150px}.login .c-tr{width:140px}.login .c-bl{width:90px}.login .c-br{width:220px}
  .login-card{margin:auto;width:min(380px,calc(100% - 32px))}
}

/* ---------- Móvil ---------- */
@media (max-width:700px){
  .content{padding:16px 14px 28px}
  .tiles,.kids,.search-row,.filters{grid-template-columns:1fr}
  .hero{padding:20px 18px}
  .hero h1{font-size:28px}
  .hero .deco{font-size:58px;right:10px;top:8px;opacity:.55}
  .page-head .right{margin-left:0;width:100%}
  .page-head .right .btn,.page-head .right .date{width:100%}
  .date{min-width:0}
  .btn{min-height:44px}
  .input,.select{font-size:16px !important;min-height:44px}
  .hbars .r{grid-template-columns:100px 1fr 42px;gap:8px}
  .lesson{flex-wrap:wrap}
  .lesson .info{flex:1;min-width:55%}
  .lesson .arrow{display:none}
  .profile-head{flex-wrap:wrap}
  .profile-head .btn{margin-left:0}
  .section-title{flex-wrap:wrap}
  .section-title .btn{margin-left:0;width:100%}
  .actions{flex-wrap:wrap}
  .actions .btn{flex:1}
  .actions .msg-err{flex-basis:100%}
  .msg{max-width:90%}
  .toast{left:14px;right:14px;bottom:14px;text-align:center}
}

/* ---------- Móvil pequeño ---------- */
@media (max-width:420px){
  .stats,.mini-stats,.summary{grid-template-columns:1fr}
  .player{flex-direction:column;align-items:stretch}
  .photo{align-self:center}
  .pf .two{grid-template-columns:84px 1fr}
  .donut{width:112px;height:112px}
  .donut span{width:76px;height:76px}
  .logo-box{width:130px;height:130px}
  .hero h1{font-size:24px}
  .top-title{font-size:15px}
}

@media (max-width:560px){.uname{display:none}.user .av{width:34px;height:34px;font-size:13px}}

/* ===================================================================
   v2 — superadmin, licencias, diálogos
   =================================================================== */
.login-err{color:var(--red);font-size:14px;font-weight:700;margin:-4px 0 12px}
.login-err:empty{display:none}
.demo-hint{margin-top:18px;font-size:13px;color:#43637c;background:#f4fafd;border:1px solid var(--line);border-radius:10px;padding:10px 12px}
.demo-hint summary{cursor:pointer;font-weight:800;color:var(--blue-d)}
.demo-hint p{margin-top:6px}
.demo-hint .btn{margin-top:10px}

.alert{display:flex;gap:10px;align-items:center;padding:12px 16px;border-radius:10px;font-size:15px;font-weight:700;margin-bottom:16px;border:1px solid transparent}
.alert.warn{background:#fff4e5;color:#b45309;border-color:#fcd9a8}
.alert.err{background:#fdecec;color:#b91c1c;border-color:#f9c6c6}
.alert.ok{background:#e4f8ee;color:#117a49;border-color:#bfeed6}
.alert.info{background:#e6f4fc;color:#0877b8;border-color:#bfe0f3}
.badge.gray{background:#eef2f5;color:#64748b}
.badge{font-size:12px}

.btn.sm{padding:6px 12px;font-size:13px;border-radius:7px}
.btn.danger{background:linear-gradient(135deg,#f87171,#ef4444 55%,#dc2626);box-shadow:0 2px 6px rgba(220,38,38,.3)}
.btn.ghost.red{color:var(--red)}
.btn[disabled]{opacity:.5;cursor:not-allowed;filter:grayscale(.3)}
.row-actions{display:flex;gap:6px;flex-wrap:wrap}
.row-actions .btn{padding:5px 10px;font-size:12px}
.table-wrap table.wide{min-width:780px}

/* Diálogos */
dialog{border:0;border-radius:16px;padding:0;width:min(540px,calc(100% - 28px));max-height:92vh;box-shadow:0 20px 60px rgba(0,0,0,.3);color:var(--text);background:#fff}
dialog[open]{display:flex;flex-direction:column}
dialog::backdrop{background:rgba(10,40,60,.5)}
.dlg-head{padding:16px 22px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:10px}
.dlg-head h3{font-size:20px}
.dlg-x{border:0;background:#eef5f9;border-radius:8px;width:34px;height:34px;cursor:pointer;color:var(--muted);display:grid;place-items:center}
.dlg-x svg.i{width:16px;height:16px}
.dlg-body{padding:18px 22px;display:flex;flex-direction:column;gap:14px;overflow:auto}
.dlg-foot{padding:14px 22px;border-top:1px solid var(--line);display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}
.dlg-err{color:var(--red);font-weight:700;font-size:14px}
.dlg-err:empty{display:none}
.logo-pick{display:flex;align-items:center;gap:14px}
.logo-pick .thumb-c{width:64px;height:64px;border-radius:50%;border:2px dashed #b9d9ea;background:#f4fafd;display:grid;place-items:center;overflow:hidden;color:var(--blue);flex:none}
.logo-pick .thumb-c img{width:100%;height:100%;object-fit:cover}
.hint{font-size:13px;color:var(--muted);font-weight:600}
.hint a{color:var(--blue-d);text-decoration:underline}
.total{background:#f4fafd;border:1px solid var(--line);border-radius:10px;padding:12px 14px;font-size:15px;display:flex;justify-content:space-between;align-items:center}
.total b{font-size:20px;color:var(--blue-d)}

/* Proyectos */
.proj-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.proj{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:16px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:12px}
.proj .top{display:flex;gap:12px;align-items:center}
.proj .lg{width:56px;height:56px;border-radius:50%;flex:none;background:linear-gradient(135deg,#2db4f0,#0877b8);color:#fff;display:grid;place-items:center;font-weight:800;font-size:20px;overflow:hidden;border:2px solid #fff;box-shadow:0 0 0 2px #cfe6f3}
.proj .lg img{width:100%;height:100%;object-fit:cover}
.proj h3{font-size:17px;line-height:1.2}
.proj small{color:var(--muted);font-size:13px;display:block}
.proj .meta{display:flex;justify-content:space-between;align-items:center;font-size:14px;gap:10px;flex-wrap:wrap}
.proj .row{display:flex;justify-content:space-between;font-size:13px;color:var(--muted);margin-bottom:5px}
.proj .row b{color:var(--text)}
.bar.warn>i{background:linear-gradient(90deg,#fb923c,#f26b1d)}
.bar.full>i{background:linear-gradient(90deg,#f87171,#dc2626)}
.empty-box{grid-column:1/-1;text-align:center;color:var(--muted);padding:34px;border:2px dashed #cfe3ee;border-radius:var(--radius);background:#fafdff;font-size:15px}

/* Licencia en la pantalla de equipo */
.lic-card{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:center;margin-bottom:16px}
.lic-card b{font-size:16px}
.lic-card small{display:block;color:var(--muted);font-size:13px;margin-top:3px}
.lic-card .row{display:flex;justify-content:space-between;font-size:14px;margin-bottom:6px}
.lic-card .bar{height:9px}

@media (max-width:700px){
  .proj-grid,.lic-card{grid-template-columns:1fr}
  .btn.sm{min-height:38px}
  .row-actions .btn{min-height:36px}
  .dlg-foot .btn{flex:1}
  .logo-pick{flex-wrap:wrap}
}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:480px){.two-col{grid-template-columns:1fr}}

/* ===================================================================
   Clases (= tareas) y estadísticas reales
   =================================================================== */
[hidden]{display:none !important}
.avatar{overflow:hidden}
.avatar img{width:100%;height:100%;object-fit:cover}
.avatar b{font-size:15px;font-weight:800;color:#14324a}
.profile-head .avatar b{font-size:22px}
.avatar.sm{width:34px;height:34px}
.avatar.sm b{font-size:13px}

.lesson .thumb{width:84px;height:60px;overflow:hidden;font-size:26px;font-weight:800;color:#fff;flex:none}
.lesson .thumb img{width:100%;height:100%;object-fit:cover}
.lesson .info{min-width:0}
.lesson .info b{overflow-wrap:anywhere}
.lesson .prog{display:flex;align-items:center;gap:10px;margin-top:6px;font-size:13px;color:var(--muted);font-weight:700}
.lesson .prog .bar{flex:1;max-width:220px}
.lesson .acts{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.lesson .acts .btn{padding:5px 10px;font-size:12px}
.thumb-c.rect{border-radius:12px;width:104px;height:68px}

.res-tools{display:flex;gap:8px;flex-wrap:wrap}
.res-list{display:flex;flex-direction:column;gap:10px}
.res-row{border:1px solid var(--line);border-radius:10px;padding:10px 12px}
.res-row.on{border-color:#bfeed6;background:#f6fcf9}
.res-row .head{display:flex;align-items:center;gap:10px;justify-content:space-between}
.res-row .who{display:flex;align-items:center;gap:10px;min-width:0}
.res-row .who b{font-size:15px;line-height:1.2}
.res-row .who small{display:block;font-size:12px;color:var(--muted)}
.res-row .chk{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:700;cursor:pointer;white-space:nowrap}
.res-row .chk input{width:20px;height:20px;accent-color:var(--green)}
.res-row .fields{display:none;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}
.res-row.on .fields{display:grid}
dialog.wide{width:min(660px,calc(100% - 28px))}

.cthumb{display:inline-grid;place-items:center;width:30px;height:30px;border-radius:7px;overflow:hidden;vertical-align:middle;margin-right:10px;background:linear-gradient(135deg,#ffd36b,#ff9f43);color:#fff;font-weight:800;font-size:14px}
.cthumb img{width:100%;height:100%;object-fit:cover}
.cthumb.t2{background:linear-gradient(135deg,#7fd1f5,#3fa9e0)}
.cthumb.t3{background:linear-gradient(135deg,#ffe58a,#f6b93b)}
td .pbar{display:flex;align-items:center;gap:10px;min-width:140px}
td .pbar .bar{flex:1}
.donut.empty-d{background:#e3eef4}
.chart-empty{text-align:center;color:var(--muted);padding:40px 10px;font-size:15px}
@media (max-width:700px){
  .lesson{align-items:flex-start}
  .lesson .acts{justify-content:flex-start;width:100%}
  .lesson .acts .btn{min-height:36px}
  .lesson .thumb{width:72px;height:54px}
  .res-row .fields{grid-template-columns:1fr}
}

.hbars .r span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.charts.single{grid-template-columns:1fr !important}
