/* ════════════════════════════════════════════
   IdeoMaker · Maqueta plataforma educativa Maker
   Estilo Tinkercad Classroom · Marca morada IdeoMaker
   ════════════════════════════════════════════ */

:root{
  --purple:#5b2487;        /* morado marca IdeoMaker */
  --purple-d:#43166a;
  --purple-l:#7c3cb0;
  --accent:#ff7a18;        /* naranjo energía maker */
  --lime:#27c93f;
  --blue:#1969ff;          /* azul Tinkercad para acentos */
  --bg:#f4f5f7;
  --card:#fff;
  --text:#1f2430;
  --muted:#7b8194;
  --border:#e6e8ee;
  --radius:14px;
  --shadow:0 1px 3px rgba(18,20,40,.06),0 6px 18px rgba(18,20,40,.05);
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
body{font-family:'Inter',system-ui,sans-serif;background:var(--bg);color:var(--text);line-height:1.5}
/* iconos SVG base */
[data-icon]{display:inline-flex;align-items:center;justify-content:center}
[data-icon] svg{width:1.15em;height:1.15em;display:block}
h1{font-family:'Poppins',sans-serif;font-size:1.7rem;font-weight:700}
h2,h3{font-family:'Poppins',sans-serif}
.muted{color:var(--muted)}
.small{font-size:.78rem}
.spacer{flex:1}
button{font-family:inherit;cursor:pointer}

/* ── TOP BAR ── */
.topbar{position:sticky;top:0;z-index:50;height:62px;background:var(--purple);
  display:flex;align-items:center;justify-content:space-between;padding:0 20px;
  box-shadow:0 2px 12px rgba(67,22,106,.25)}
.topbar-left{display:flex;align-items:center;gap:12px}
.hamburger{display:none;background:none;border:none;color:#fff;font-size:1.4rem}
.brand-logo{height:30px;background:#fff;padding:4px 8px;border-radius:8px}
.brand-sub{color:#e7d6f7;font-weight:600;font-size:.95rem;letter-spacing:.3px}
.topbar-nav{display:flex;gap:6px}
.topbar-nav a{color:#e7d6f7;text-decoration:none;font-weight:500;font-size:.9rem;
  padding:8px 14px;border-radius:8px;transition:.15s}
.topbar-nav a:hover{background:rgba(255,255,255,.12);color:#fff}
.topbar-nav a.active{color:#fff;background:rgba(255,255,255,.16)}
.topbar-right{display:flex;align-items:center;gap:12px}
.btn-search{background:rgba(255,255,255,.14);border:none;color:#fff;width:38px;height:38px;
  border-radius:50%;font-size:1rem;display:inline-flex;align-items:center;justify-content:center}
.btn-search [data-icon] svg{width:18px;height:18px}
.btn-create{background:var(--accent);color:#fff;border:none;font-weight:600;font-size:.88rem;
  padding:9px 18px;border-radius:22px;box-shadow:0 4px 12px rgba(255,122,24,.35);transition:.15s;
  display:inline-flex;align-items:center;gap:7px}
.btn-create [data-icon] svg{width:16px;height:16px}
.btn-create:hover{filter:brightness(1.05);transform:translateY(-1px)}
.btn-create.sm{padding:7px 14px;font-size:.8rem}
.btn-create.big{padding:13px 24px;font-size:1rem;width:100%;border-radius:12px}
.avatar-chip{position:relative}
.avatar-circle{width:40px;height:40px;border-radius:50%;background:#fff;color:var(--purple);
  display:flex;align-items:center;justify-content:center;font-weight:700;font-size:.85rem;
  border:2px solid var(--accent)}
.avatar-badge{position:absolute;bottom:-4px;right:-8px;background:var(--purple-d);color:#fff;
  font-size:.6rem;font-weight:700;padding:1px 6px;border-radius:10px;border:1px solid #fff}

/* ── LAYOUT ── */
.layout{display:flex;min-height:calc(100vh - 62px)}

/* ── SIDEBAR ── */
.sidebar{width:248px;background:var(--card);border-right:1px solid var(--border);
  display:flex;flex-direction:column;padding:18px 14px;position:sticky;top:62px;
  height:calc(100vh - 62px);overflow-y:auto;flex-shrink:0}
.side-profile{display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:14px 0 18px;border-bottom:1px solid var(--border);margin-bottom:12px}
.side-avatar{width:58px;height:58px;border-radius:50%;
  background:linear-gradient(135deg,var(--purple),var(--purple-l));color:#fff;
  display:flex;align-items:center;justify-content:center;font-weight:700;font-size:1.1rem}
.side-profile strong{font-size:.92rem}
.side-badges{font-size:.72rem;color:var(--accent);font-weight:600;display:inline-flex;align-items:center;gap:5px}
.side-badges [data-icon] svg{width:14px;height:14px}
.side-nav{display:flex;flex-direction:column;gap:2px}
.nav-item{display:flex;align-items:center;gap:11px;padding:11px 13px;border-radius:10px;
  color:var(--text);text-decoration:none;font-weight:500;font-size:.88rem;cursor:pointer;transition:.12s}
.nav-item .ico{width:20px;height:20px;flex-shrink:0}
.nav-item .ico svg{width:20px;height:20px}
.nav-item:hover{background:#f3eefa;color:var(--purple)}
.nav-item.active{background:linear-gradient(135deg,var(--purple),var(--purple-l));color:#fff}
.side-foot{margin-top:auto;padding-top:16px}
.side-cta{background:#f3eefa;border-radius:12px;padding:14px;text-align:center}
.side-cta strong{display:block;font-size:.85rem;color:var(--purple-d)}
.side-cta p{font-size:.74rem;color:var(--muted);margin:4px 0 10px}

/* ── CONTENT ── */
.content{flex:1;padding:30px 36px 60px;max-width:1240px;margin:0 auto;width:100%}
.view{display:none;animation:fade .25s ease}
.view.active{display:block}
@keyframes fade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.page-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:22px;gap:16px}
.page-head p{margin-top:2px}
.back{color:var(--purple);font-weight:600;font-size:.85rem;cursor:pointer;display:inline-block;margin-bottom:14px}
.sec-title{font-size:1.15rem;margin:30px 0 14px;color:var(--purple-d)}

/* ── SUBTABS ── */
.subtabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:20px;border-bottom:2px solid var(--border)}
.subtab{background:none;border:none;padding:10px 16px;font-size:.86rem;font-weight:600;
  color:var(--muted);border-radius:20px;border-bottom:3px solid transparent;margin-bottom:-2px;transition:.15s}
.subtab.active{color:var(--purple);background:#f3eefa;border-bottom-color:var(--purple)}
.subtab:hover{color:var(--purple)}

/* ── TOOLBAR ── */
.list-toolbar{display:flex;align-items:center;gap:10px;margin-bottom:18px;flex-wrap:wrap}
.btn-ghost{background:var(--card);border:1px solid var(--border);color:var(--text);
  padding:8px 16px;border-radius:20px;font-size:.84rem;font-weight:500}
.btn-ghost:hover{border-color:var(--purple);color:var(--purple)}
.btn-ghost.sm{padding:6px 12px;font-size:.78rem}
.sort{font-size:.82rem;color:var(--muted);cursor:pointer}
.search-input{padding:8px 14px;border:1px solid var(--border);border-radius:20px;font-size:.84rem;min-width:200px}
.search-input:focus{outline:none;border-color:var(--purple)}

/* ── CLASS LIST ── */
.class-list{display:flex;flex-direction:column;gap:10px}
.class-row{display:flex;align-items:center;gap:16px;background:var(--card);border:1px solid var(--border);
  border-radius:var(--radius);padding:14px 18px;box-shadow:var(--shadow);cursor:pointer;transition:.15s}
.class-row:hover{border-color:var(--purple-l);transform:translateX(2px)}
.chk{width:18px;height:18px;border:2px solid var(--border);border-radius:5px;flex-shrink:0}
.class-icon{width:46px;height:46px;border-radius:12px;display:flex;align-items:center;justify-content:center;
  flex-shrink:0}
.class-icon svg{width:24px;height:24px}
.i-robot{background:#e8efff;color:var(--blue)}
.i-print{background:#fff0e6;color:#e8590c}
.i-code{background:#eafaf0;color:#16a34a}
.i-pod{background:#f3eafd;color:var(--purple)}
.class-main{flex:1;display:flex;flex-direction:column;min-width:0}
.class-main strong{font-size:.96rem}
.class-main .muted{font-size:.78rem}
.pill{background:#f3eefa;color:var(--purple);font-size:.74rem;font-weight:600;padding:5px 12px;
  border-radius:14px;white-space:nowrap}
.code-chip{background:var(--purple-d);color:#fff;font-family:monospace;font-size:.74rem;font-weight:700;
  padding:5px 11px;border-radius:8px;letter-spacing:.5px;white-space:nowrap}
.dots{background:none;border:none;color:var(--muted);padding:0 6px;display:inline-flex;align-items:center}
.dots svg{width:18px;height:18px}
.dots:hover{color:var(--purple)}

/* ── DETALLE ── */
.detail-head{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:14px}
.detail-actions{display:flex;gap:10px;flex-wrap:wrap}
.code-copy{background:#f3eefa;border:1px dashed var(--purple-l);color:var(--purple-d);font-family:monospace;
  font-weight:700;padding:9px 16px;border-radius:10px;font-size:.84rem;display:inline-flex;align-items:center;gap:7px}
.code-copy svg{width:15px;height:15px}
.detail-meta{display:flex;gap:20px;flex-wrap:wrap;align-items:center;background:var(--card);
  border:1px solid var(--border);border-radius:12px;padding:14px 18px;margin-bottom:22px;font-size:.86rem;color:var(--muted)}
.detail-meta>span{display:inline-flex;align-items:center;gap:7px}
.detail-meta svg{width:16px;height:16px;color:var(--purple-l)}
.safe-mode{margin-left:auto;display:flex;align-items:center;gap:8px;font-size:.84rem}
.toggle{width:38px;height:20px;border-radius:12px;background:#cfd3de;position:relative;flex-shrink:0;cursor:pointer}
.toggle::after{content:'';position:absolute;width:16px;height:16px;border-radius:50%;background:#fff;top:2px;left:2px;transition:.2s}
.toggle.on{background:var(--lime)}.toggle.on::after{left:20px}

/* ── STUDENT TABLE ── */
.student-table{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);
  overflow:hidden;box-shadow:var(--shadow)}
.st-head,.st-row{display:grid;grid-template-columns:24px 2.2fr 1fr 1.2fr .8fr 1fr 40px;
  align-items:center;gap:12px;padding:13px 18px}
.st-head{background:#faf8fd;font-size:.72rem;text-transform:uppercase;letter-spacing:.5px;
  color:var(--muted);font-weight:700;border-bottom:1px solid var(--border)}
.st-row{border-bottom:1px solid var(--border)}
.st-row:hover{background:#faf8fd}
.st-row:last-child{border-bottom:none}
.st-name{display:flex;align-items:center;gap:11px}
.st-name strong{font-size:.88rem;display:block}
.st-av{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  color:#fff;font-weight:700;font-size:.85rem;flex-shrink:0}
.st-av.blue{background:var(--blue)}.st-av.photo{background:linear-gradient(135deg,#ff7a18,#ff4d6d)}
.type{font-size:.8rem;color:var(--muted);font-weight:600}
.type.acct{color:var(--purple)}
.hex{font-size:.82rem;color:var(--muted);font-weight:600}

/* ── COURSE CARDS ── */
.card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:18px}
.course-card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);
  overflow:hidden;box-shadow:var(--shadow);transition:.15s}
.course-card:hover{transform:translateY(-3px);box-shadow:0 10px 28px rgba(67,22,106,.12)}
.cc-cover{height:110px;display:flex;align-items:center;justify-content:center}
.cc-cover svg{width:44px;height:44px}
.c1{background:linear-gradient(135deg,#dbe7ff,#b9ceff);color:#1957d6}
.c2{background:linear-gradient(135deg,#ffe6d2,#ffc8a0);color:#d4540a}
.c3{background:linear-gradient(135deg,#ede0ff,#d3b6ff);color:#7c3cb0}
.c4{background:linear-gradient(135deg,#d8f8e4,#a8eec2);color:#15803d}
.c5{background:linear-gradient(135deg,#fde0f0,#f9bcdd);color:#c43077}
.cc-body{padding:14px 16px}
.tag{display:inline-block;background:#f3eefa;color:var(--purple);font-size:.68rem;font-weight:700;
  padding:3px 10px;border-radius:12px;text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px}
.cc-body h3{font-size:.98rem;margin-bottom:4px}
.cc-body .muted{font-size:.78rem}
.progressbar{height:8px;background:#eceef3;border-radius:6px;overflow:hidden;margin:10px 0 5px}
.progressbar span{display:block;height:100%;background:linear-gradient(90deg,var(--purple),var(--accent));border-radius:6px}
.progressbar.sm{height:6px;margin:6px 0 0;width:140px}
.course-card.add{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;
  border:2px dashed var(--border);background:#faf8fd;color:var(--muted);cursor:pointer;min-height:200px}
.course-card.add:hover{border-color:var(--purple);color:var(--purple)}
.cc-add{color:var(--purple-l)}
.cc-add svg{width:38px;height:38px}

/* ── RESOURCES ── */
.res-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}
.res-card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:18px 16px;
  display:flex;flex-direction:column;gap:6px;box-shadow:var(--shadow);transition:.15s}
.res-card:hover{transform:translateY(-2px);border-color:var(--purple-l)}
.res-card strong{font-size:.86rem}
.res-ico{width:46px;height:46px;border-radius:11px;display:flex;align-items:center;justify-content:center;margin-bottom:4px}
.res-ico svg{width:24px;height:24px}
.res-ico.v{background:#ffe6e6;color:#e11d48}
.res-ico.d{background:#e6efff;color:var(--blue)}
.res-ico.m{background:#e9fbef;color:#16a34a}
.res-ico.c{background:#f0e9fc;color:var(--purple)}

/* ── LABS ── */
.lab-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:18px}
.lab-card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.lab-head{padding:16px 18px;display:flex;justify-content:space-between;align-items:center;color:#fff}
.lab-head.c1{background:linear-gradient(135deg,var(--blue),#4f8bff)}
.lab-head.c2{background:linear-gradient(135deg,var(--accent),#ff9f4d)}
.lab-head.c5{background:linear-gradient(135deg,var(--purple),var(--purple-l))}
.lab-head h3{font-size:1.05rem}
.lab-status{font-size:.7rem;font-weight:700;padding:4px 10px;border-radius:12px;background:rgba(255,255,255,.25)}
.lab-body{padding:16px 18px}
.lab-stat{display:flex;justify-content:space-between;padding:10px 0;border-bottom:1px solid var(--border);font-size:.86rem}
.lab-stat span{color:var(--muted)}
.equip{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
.eq{background:#f3eefa;color:var(--purple-d);font-size:.74rem;font-weight:600;padding:6px 11px;border-radius:10px;
  display:inline-flex;align-items:center;gap:6px}
.eq [data-icon] svg{width:14px;height:14px;color:var(--purple-l)}
.lab-foot{margin-top:6px}

/* ── PROJECTS ── */
.card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow)}
.proj-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.proj-list{display:flex;flex-direction:column;gap:6px}
.proj-item{display:grid;grid-template-columns:36px 1.5fr 1fr 1fr auto;align-items:center;gap:14px;
  padding:10px 8px;border-bottom:1px solid var(--border);font-size:.88rem}
.proj-item:last-child{border-bottom:none}
.badge{font-size:.72rem;font-weight:700;padding:3px 11px;border-radius:12px;text-align:center}
.badge.ok{background:#d8f8e4;color:#15803d}
.badge.pend{background:#fff1cf;color:#a8730a}

/* ── BADGES / LOGROS ── */
.badge-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:16px}
.badge-card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);
  padding:22px 14px;text-align:center;box-shadow:var(--shadow);transition:.15s}
.badge-card:hover{transform:translateY(-3px)}
.badge-medal{width:64px;height:64px;margin:0 auto 10px;border-radius:50%;display:flex;align-items:center;
  justify-content:center;background:#f3eefa;color:var(--purple)}
.badge-medal svg{width:30px;height:30px}
.badge-card strong{display:block;font-size:.86rem}
.cert-row{display:flex;flex-direction:column;gap:10px}
.cert{display:flex;align-items:center;gap:14px;background:var(--card);border:1px solid var(--border);
  border-radius:12px;padding:14px 18px;box-shadow:var(--shadow)}
.cert-ribbon{width:40px;height:40px;border-radius:50%;background:#f3eefa;color:var(--purple);
  display:flex;align-items:center;justify-content:center;flex-shrink:0}
.cert-ribbon svg{width:22px;height:22px}
.cert div{flex:1}
.cert strong{display:block;font-size:.9rem}

/* ── STUDENT JOIN ── */
.student-join{display:grid;grid-template-columns:1fr 1fr;gap:28px;align-items:start}
.join-card{background:var(--card);border:1px solid var(--border);border-radius:20px;padding:40px 34px;
  text-align:center;box-shadow:var(--shadow)}
.join-logo{height:42px;margin:0 auto 18px}
.join-card h2{font-size:1.5rem;margin-bottom:6px}
.join-card p{margin-bottom:22px}
.code-input{display:flex;gap:8px;justify-content:center;margin-bottom:22px}
.code-input input{width:48px;height:56px;text-align:center;font-size:1.5rem;font-weight:700;
  border:2px solid var(--border);border-radius:12px;color:var(--purple);text-transform:uppercase}
.code-input input:focus{outline:none;border-color:var(--purple)}
.join-card .small{display:block;margin-top:14px;color:var(--purple);cursor:pointer}
.join-preview{background:var(--card);border:1px solid var(--border);border-radius:20px;padding:28px;box-shadow:var(--shadow)}
.join-preview h3{font-size:1.1rem;margin-bottom:16px}
.sp-card{display:flex;align-items:center;gap:14px;padding:14px;border:1px solid var(--border);
  border-radius:12px;margin-bottom:12px}
.sp-card .ico{width:40px;height:40px;border-radius:11px;background:#f3eefa;color:var(--purple);
  display:flex;align-items:center;justify-content:center;flex-shrink:0}
.sp-card .ico svg{width:22px;height:22px}
.sp-card strong{display:block;font-size:.9rem}

/* ── MODAL ── */
.modal-overlay{display:none;position:fixed;inset:0;background:rgba(31,18,52,.55);z-index:100;
  align-items:center;justify-content:center;padding:20px}
.modal-overlay.show{display:flex}
.modal{background:var(--card);border-radius:18px;padding:30px;width:100%;max-width:460px;
  box-shadow:0 30px 80px rgba(31,18,52,.4)}
.modal h3{font-size:1.25rem;margin-bottom:20px;color:var(--purple-d)}
.fg{margin-bottom:14px}
.fg label{display:block;font-size:.8rem;font-weight:600;color:var(--muted);margin-bottom:5px}
.fg input,.fg select{width:100%;padding:11px 14px;border:1px solid var(--border);border-radius:10px;font-size:.9rem;font-family:inherit}
.fg input:focus,.fg select:focus{outline:none;border-color:var(--purple)}
.code-preview{background:#f3eefa;border-radius:10px;padding:12px 14px;font-size:.84rem;color:var(--muted);margin:6px 0 20px}
.code-preview strong{color:var(--purple-d);font-family:monospace;font-size:1rem}
.fa{display:flex;gap:10px;justify-content:flex-end}
.btn-cancel{background:#eceef3;border:none;color:var(--text);padding:11px 20px;border-radius:22px;font-weight:600;font-size:.86rem}

/* ── RESPONSIVE ── */
@media(max-width:900px){
  .hamburger{display:block}
  .topbar-nav{display:none}
  .sidebar{position:fixed;left:-260px;top:62px;z-index:40;transition:.25s;box-shadow:4px 0 24px rgba(0,0,0,.15)}
  .sidebar.open{left:0}
  .content{padding:20px 16px 50px}
  .student-join{grid-template-columns:1fr}
  .st-head{display:none}
  .st-row{grid-template-columns:1fr auto;grid-auto-rows:auto;gap:8px}
  .st-row .type,.st-row .hex,.st-row .toggle{display:none}
  .detail-meta{flex-direction:column;align-items:flex-start;gap:10px}
  .safe-mode{margin-left:0}
  .class-row{flex-wrap:wrap}
  .class-row .muted.small{display:none}
}
@media(max-width:560px){
  .brand-sub{display:none}
  .class-icon{width:40px;height:40px}
  .code-input input{width:40px;height:48px;font-size:1.2rem}
}
