/* ── Pantalla de login ───────────────────────────────────── */
body[data-auth="false"] #sidebar { display: none; }
body[data-auth="false"] { grid-template-columns: 1fr; }
body[data-auth="false"] #view {
  max-width: none; padding: 0;
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%; max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.auth-brand {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 28px; gap: 12px;
}
.auth-logo {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, var(--green), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #0A0F1E; font-size: 24px;
  box-shadow: 0 8px 24px rgba(0,212,170,0.35);
}
.auth-tagline { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.auth-logo-img {
  display: block;
  width: 100%; max-width: 220px;
  height: auto;
  border-radius: 12px;
  margin: 0 auto;
  background: #fff;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.auth-title { font-size: 20px; font-weight: 700; letter-spacing: -0.4px; color: var(--text-strong); }

.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.auth-form .form-input { padding: 12px 14px; font-size: 14px; }
.auth-form .btn.primary { padding: 12px; font-size: 14px; justify-content: center; }
.auth-form .btn.primary[disabled] { opacity: 0.55; cursor: not-allowed; }

.auth-error {
  background: var(--red-bg);
  border: 1px solid rgba(255,71,87,0.25);
  color: var(--red);
  padding: 10px 12px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 11px;
  display: flex; align-items: flex-start; gap: 8px;
}
.auth-error.auth-success {
  background: var(--green-bg, rgba(46,213,115,0.12));
  border-color: rgba(46,213,115,0.28);
  color: var(--green, #2ed573);
}
.auth-help {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  margin-top: 18px;
  line-height: 1.6;
}
.auth-help a {
  color: var(--accent, #4a9eff);
  text-decoration: none;
  cursor: pointer;
}
.auth-help a:hover { text-decoration: underline; }
.auth-form a {
  color: var(--accent, #4a9eff);
  text-decoration: none;
  cursor: pointer;
  font-family: var(--mono);
}
.auth-form a:hover { text-decoration: underline; }

/* ── Spinner pequeño dentro del botón ─────────────────────── */
.btn .spinner-sm {
  width: 14px; height: 14px;
  border: 2px solid rgba(10,15,30,0.2);
  border-top-color: #0A0F1E;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Splash de boot (mientras Firebase autentica) ────────── */
.boot-splash {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; z-index: 99999;
}
.boot-splash .brand-logo { width: 56px; height: 56px; border-radius: 14px; font-size: 24px; }
.boot-splash .splash-logo { width: 140px; height: auto; border-radius: 14px; background: #fff; padding: 10px; }
.boot-splash-text { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ── Banner de impersonation (admin viendo como alumno) ──── */
.imp-banner {
  background: linear-gradient(90deg, rgba(255,165,2,0.15), rgba(255,165,2,0.08));
  border: 1px solid rgba(255,165,2,0.4);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.imp-banner-icon { font-size: 16px; }
.imp-banner-text {
  flex: 1;
  font-size: 13px;
  color: var(--orange);
  font-weight: 500;
}
.imp-banner-text strong { color: var(--text-strong); }
.imp-banner-text .meta { color: var(--muted); font-family: var(--mono); font-size: 11px; margin-left: 8px; }

/* ── Indicador de conexión ───────────────────────────────── */
.conn-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px;
  background: var(--surface);
}
.conn-badge.online  { color: var(--green); border-color: var(--green); }
.conn-badge.offline { color: var(--orange); border-color: var(--orange); }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; }
.conn-badge.online .conn-dot  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.conn-badge.offline .conn-dot { background: var(--orange); }

/* ── Sidebar: bloque usuario inferior ────────────────────── */
.user-block {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--zonas));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 13px;
  flex-shrink: 0;
  text-transform: uppercase;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 10px; color: var(--muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-logout {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 6px; border-radius: 6px;
  font-size: 14px; flex-shrink: 0;
}
.user-logout:hover { color: var(--red); background: var(--hover); }

/* ── Sidebar colapsada (mobile/tablet) ───────────────────── */
@media (max-width: 1100px) {
  .user-info { display: none; }
  .user-block { justify-content: center; padding: 12px 0; gap: 6px; }
}
