﻿:root {
  --bg: #06071a;
  --bg2: #101231;
  --bg3: #1a1d45;
  --line: #2b2f66;
  --txt: #eef0ff;
  --muted: #9aa2e0;
  --acc: #6366f1;
  --acc2: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f43f5e;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1000px 520px at 88% -12%, rgba(34, 211, 238, 0.16), transparent 58%),
    radial-gradient(860px 460px at 4% 0%, rgba(99, 102, 241, 0.22), transparent 55%),
    radial-gradient(700px 500px at 50% 110%, rgba(244, 63, 94, 0.08), transparent 50%),
    var(--bg);
  color: var(--txt);
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.hidden { display: none !important; }

.view { min-height: 100vh; }

/* AUTH */
.auth-bg { position: fixed; inset: 0; z-index: 1; overflow: hidden; }
.auth-bg-img {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  background: url("https://i.ibb.co/QvWkt7Cv/fondo-02.jpg") center/cover no-repeat, #020617;
  filter: brightness(0.7) contrast(1.15) saturate(1.2);
  animation: bgPan 40s ease-in-out infinite alternate;
}
@keyframes bgPan {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.15) translate(3%, 2%); }
}
.auth-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(2, 6, 23, 0.8) 0%, rgba(15, 23, 42, 0.4) 100%);
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.6;
  animation: floatOrb 12s infinite ease-in-out alternate;
  pointer-events: none;
}
.orb-1 { width: 500px; height: 500px; background: #22d3ee; top: -15%; left: -15%; animation-duration: 22s; }
.orb-2 { width: 600px; height: 600px; background: #6366f1; bottom: -25%; right: -15%; animation-duration: 28s; animation-delay: -7s; }
@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(80px, 80px) scale(1.15); }
}

.auth-wrap {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.auth-card {
  width: 100%;
  max-width: 460px;
  margin: 20px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 48px;
  border-radius: 32px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: cardIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: none; }
}
.auth-header { text-align: center; margin-bottom: 36px; }
.logo {
  font-family: "Outfit", sans-serif;
  font-size: 40px;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  letter-spacing: -0.03em;
}
.logo-badge {
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  color: #fff;
  padding: 10px 18px;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(14, 165, 233, 0.4);
  font-size: 26px;
  line-height: 1;
}
.logo-text { color: #fff; }
.auth-sub { color: var(--muted); margin-top: 10px; font-size: 15px; }
.form-section { display: flex; flex-direction: column; gap: 18px; }
.form-section input {
  width: 100%;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: #fff;
  font-size: 15px;
  font-family: "Inter", system-ui, sans-serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-section input::placeholder { color: rgba(255, 255, 255, 0.4); }
.form-section input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: #22d3ee;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
  transform: translateY(-2px);
}
.btn-entrar {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  color: #fff;
  border: none;
  padding: 18px;
  border-radius: 16px;
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  font-size: 17px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.35);
  position: relative;
  overflow: hidden;
}
.btn-entrar::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-20deg);
  transition: all 0.7s ease;
}
.btn-entrar:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(14, 165, 233, 0.5);
  filter: brightness(1.1);
}
.btn-entrar:hover::after { left: 150%; }
.btn-entrar:disabled { opacity: 0.6; cursor: default; transform: none; }
.org-pick-btn { text-align: left; }
.auth-status { text-align: center; font-size: 14px; color: #22d3ee; min-height: 20px; font-weight: 500; }
.auth-status.error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.45);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  padding: 9px 12px;
  min-height: 0;
}
.auth-demo {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.auth-demo small { color: rgba(255, 255, 255, 0.45); }
.auth-demo b { color: #a5f3fc; font-weight: 600; }
.demo-link {
  background: none;
  border: 0;
  color: #22d3ee;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.demo-link:hover { color: #a5f3fc; }
.demo-banner {
  background: rgba(34, 211, 238, 0.10);
  border-bottom: 1px solid rgba(34, 211, 238, 0.30);
  color: #a5f3fc;
  text-align: center;
  padding: 9px 18px;
  font-size: 12.5px;
  letter-spacing: 0.01em;
}
.demo-banner b { color: #22d3ee; letter-spacing: 0.08em; }

.brand { font-size: 24px; font-weight: 700; color: var(--acc2); }
.brand.small { font-size: 18px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 5px; font-weight: 600; letter-spacing: 0.3px; }
input, select {
  width: 100%;
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--txt);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--acc2);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}
/* Chrome en Windows pinta el popup de <select> con colores del sistema.
   Forzamos las opciones para que no salgan blancas sobre blanco. */
select, select option { color-scheme: dark; }
select option {
  background: #101231;
  color: #eef0ff;
}
html[data-theme="light"] select, html[data-theme="light"] select option { color-scheme: light; }
html[data-theme="light"] select option {
  background: #ffffff;
  color: #0f172a;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg3);
  color: var(--txt);
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.2s ease;
}
.btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  color: #06071a;
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.35);
}
.btn.primary:hover { box-shadow: 0 12px 30px rgba(34, 211, 238, 0.4); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--txt); }
.btn.danger {
  background: linear-gradient(135deg, var(--danger), #fb7185);
  color: #fff;
  box-shadow: 0 8px 20px rgba(244, 63, 94, 0.3);
}
.btn.small { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn.block { width: 100%; margin-top: 16px; }

.error {
  background: #7f1d1d;
  color: #fecaca;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  margin-top: 12px;
}

/* TOPBAR */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 14px 18px 0;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 14px;
  z-index: 30;
}
.brand.small {
  font-family: "Outfit", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.8);
}
.topbar nav {
  display: flex;
  gap: 4px;
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 4px;
}
.topbar nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 9px 14px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: "Outfit", sans-serif;
  transition: all 0.25s ease;
}
.topbar nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.topbar nav a.active {
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  color: #06071a;
  box-shadow: 0 8px 22px rgba(34, 211, 238, 0.35);
}
.user { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  font-family: "Outfit", sans-serif;
  flex-shrink: 0;
}
#user-email { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn {
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(127, 29, 29, 0.35);
  color: #fca5a5;
  border-radius: 11px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: "Outfit", sans-serif;
}
.logout-btn:hover { background: rgba(239, 68, 68, 0.55); color: #fff; }

.content { padding: 24px; max-width: 1200px; margin: 0 auto; }
h2 { margin: 0 0 18px; font-size: 20px; }
h3 { margin: 24px 0 12px; font-size: 15px; color: var(--acc2); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sec-head h2 { margin-bottom: 0; }
.tools { display: flex; gap: 8px; align-items: center; }
.tools input { width: 240px; }
#dom-org { width: auto; min-width: 220px; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 14px; }

/* CARDS */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.card-stat {
  background: linear-gradient(160deg, rgba(99, 102, 241, 0.14), rgba(34, 211, 238, 0.05) 60%, var(--bg2));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card-stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--acc), var(--acc2));
  opacity: 0.9;
}
.card-stat:hover { transform: translateY(-3px); border-color: var(--acc2); box-shadow: 0 14px 34px rgba(34, 211, 238, 0.14); }
.card-stat .n { font-size: 30px; font-weight: 800; background: linear-gradient(135deg, #fff, #b3b8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card-stat .l { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 500; }

/* LISTAS */
.list { display: flex; flex-direction: column; gap: 8px; }
.row-item {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), var(--bg2));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.row-item:hover { border-color: var(--acc2); box-shadow: 0 6px 20px rgba(34, 211, 238, 0.08); }
.row-item .grow { flex: 1; min-width: 200px; }
.row-item .title { font-weight: 600; font-size: 14px; }
.row-item .sub { color: var(--muted); font-size: 12px; margin-top: 3px; word-break: break-all; }
.row-item.clickable { cursor: pointer; }
.row-item.clickable:hover { border-color: var(--acc2); transform: translateY(-1px); }
.list.small .row-item { padding: 9px 12px; font-size: 13px; }

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}
.badge.ok { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.3); }
.badge.pending { background: rgba(251, 191, 36, 0.16); color: #fcd34d; border: 1px solid rgba(251, 191, 36, 0.3); }
.badge.gray { background: var(--bg3); color: var(--muted); border: 1px solid var(--line); }
.badge.danger { background: rgba(244, 63, 94, 0.16); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.3); }

.actions-row { display: flex; gap: 6px; }

.login-help { display: inline-block; margin-top: 12px; color: var(--acc2); font-size: 13px; text-decoration: none; }
.login-help:hover { text-decoration: underline; }

.mail-card { padding: 18px; display: grid; gap: 10px; }
.mail-card .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mail-card .big { font-size: 17px; font-weight: 700; }
.mail-card .scope { font-family: monospace; font-size: 11px; word-break: break-all; color: var(--muted); }

/* TABLA-like device list */
.dev-head, .dev-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr 1fr 1.2fr 1.2fr auto;
  gap: 12px;
  padding: 10px 14px;
  align-items: center;
  font-size: 13px;
}
.dev-head { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.dev-row {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), var(--bg2));
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.dev-row:hover { border-color: var(--acc2); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(34, 211, 238, 0.08); }

/* DETALLE */
.detail-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.panel {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.04), var(--bg2));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.panel-title { font-size: 13px; font-weight: 700; color: var(--acc2); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.live-dot { width: 8px; height: 8px; background: var(--danger); border-radius: 50%; display: inline-block; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
.live-img { width: 100%; border-radius: 8px; background: #000; min-height: 200px; object-fit: contain; }
.live-wrap { position: relative; }
.live-state { position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.live-state .live-state-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.92); }
.live-state.idle { background: rgba(217,119,6,.94); }
.live-state.closed { background: rgba(220,38,38,.94); }
.meta { font-size: 13px; margin-top: 10px; color: var(--muted); }
.meta a, .kv a { color: var(--acc2); word-break: break-all; }
.history { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.hist-item {
  font-size: 12px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.02), var(--bg));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  transition: border-color 0.2s ease;
}
.hist-item:hover { border-color: var(--acc2); }
.hist-item .u { color: var(--txt); word-break: break-all; }
.hist-item .t { color: var(--muted); font-size: 11px; margin-top: 3px; }

/* FOTOS */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.photo-cell {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.03), var(--bg2));
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.photo-cell:hover { border-color: var(--acc2); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(34, 211, 238, 0.12); }
.photo-cell img { width: 100%; height: 130px; object-fit: cover; display: block; background: #000; }
.photo-cell .cap { padding: 8px 9px; font-size: 11px; color: var(--muted); word-break: break-all; }
.photo-big { width: 100%; max-height: 60vh; object-fit: contain; background: #000; border-radius: 8px; }

/* MODALES */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 20, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal .card {
  background: linear-gradient(170deg, rgba(99, 102, 241, 0.08), rgba(16, 18, 49, 0.97));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  width: 440px;
  max-width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.modal .card.wide { width: 780px; }
.modal h3 { margin: 0 0 14px; color: var(--txt); }
.kv { font-size: 13px; margin-bottom: 8px; }
.kv span { color: var(--muted); }
.kv b { font-family: monospace; word-break: break-all; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.org-pick { display: flex; flex-direction: column; gap: 7px; max-height: 240px; overflow-y: auto; }
.org-opt {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.02), var(--bg));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.2s ease, transform 0.15s ease, background 0.2s ease;
}
.org-opt:hover { border-color: var(--acc2); transform: translateY(-1px); }
.org-opt.sel {
  border-color: var(--acc);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(34, 211, 238, 0.1));
  box-shadow: 0 0 0 1px var(--acc) inset;
}
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 16px; }
@media (max-width: 760px) { .cfg-grid { grid-template-columns: 1fr; } }
.empty { color: var(--muted); font-size: 13px; padding: 14px; text-align: center; background: var(--bg2); border: 1px dashed var(--line); border-radius: 10px; }

@media (max-width: 860px) { .topbar { flex-wrap: wrap; gap: 10px; } .topbar nav { order: 3; width: 100%; overflow-x: auto; } #user-email { display: none; } }

/* BLOQUEAR URLS */
.blk-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 12px 0 16px; }
.blk-mode {
  background: linear-gradient(160deg, rgba(99, 102, 241, 0.1), rgba(34, 211, 238, 0.04) 70%, var(--bg2));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  transition: border-color 0.2s ease;
}
.blk-mode:hover { border-color: var(--acc2); }
.blk-mode label { margin: 0 0 10px; font-weight: 700; color: var(--txt); }
.blk-mode .tools { display: flex; gap: 8px; }
.blk-mode .tools input { flex: 1; width: auto; }
.blk-mode textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--txt);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  padding: 10px;
  resize: vertical;
  margin-bottom: 10px;
}
.blk-mode textarea:focus { outline: none; border-color: var(--acc2); }
.blk-template {
  margin: 10px 0 0;
  padding: 10px;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  overflow-x: auto;
}
.cat-row { background: linear-gradient(90deg, rgba(34, 211, 238, 0.1), rgba(99, 102, 241, 0.04)); border-left: 3px solid var(--acc2); }

/* CATEGORÍAS */
.cats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; max-height: 50vh; overflow-y: auto; }
.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.03), var(--bg2));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.cat-item:hover { border-color: var(--acc2); transform: translateY(-1px); }
.cat-item.forced { border-color: rgba(239, 68, 68, 0.5); background: rgba(127, 29, 29, 0.2); cursor: not-allowed; }
.cat-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cat-info b { font-size: 13px; }
.cat-info span { font-size: 11px; color: var(--muted); }
.cat-item input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--acc); }
.cat-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.cat-immune { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.cat-immune label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 10.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.cat-immune input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: var(--warn); }
.cat-immune input[type="checkbox"]:disabled { opacity: 0.55; cursor: not-allowed; }
.flt-cats { max-height: 190px; margin: 8px 0 16px; }
.flt-cats .cat-item { padding: 9px 11px; }
#flt-conflict-warn { margin: 10px 0 0; color: var(--warn); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 760px) { .blk-modes, .cats-grid { grid-template-columns: 1fr; } }

/* LIBERTAD TOTAL */
.freedom-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(150deg, rgba(52, 211, 153, 0.08), rgba(99, 102, 241, 0.04) 70%, var(--bg2));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 12px 0;
  transition: border-color 0.2s ease;
}
.freedom-bar:hover { border-color: rgba(52, 211, 153, 0.4); }
.fb-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fb-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.mins-pick { display: flex; gap: 6px; }
.mins-pick button {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.mins-pick button:hover { color: var(--txt); border-color: var(--acc2); }
.mins-pick button.sel {
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  border-color: transparent;
  color: #06071a;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(34, 211, 238, 0.35);
}

/* CONFIRMACIÓN */
.confirm-text p { font-size: 13px; line-height: 1.55; color: var(--muted); margin: 10px 0; }
.confirm-text p b { color: var(--txt); }
.confirm-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(99, 102, 241, 0.1));
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: #7dd3fc;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
}

/* PICK LIST (asignar filtro) */
.pick-list { max-height: 45vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.pick-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.02), var(--bg2));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.pick-item:hover { border-color: var(--acc2); transform: translateY(-1px); }
.pick-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--acc); flex-shrink: 0; }
.pick-item .grow { min-width: 0; }
.pick-item .sub { font-size: 11px; color: var(--muted); }

#modal-filter textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--txt);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  padding: 10px;
  resize: vertical;
  margin: 6px 0 14px;
}
#modal-filter textarea:focus { outline: none; border-color: var(--acc2); }

/* ---------- HORARIO ---------- */
.hor-status { font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.hor-status.on { color: #6ee7b7; background: rgba(52, 211, 153, 0.14); border: 1px solid rgba(52, 211, 153, 0.3); }
.hor-status.out { color: #fda4af; background: rgba(244, 63, 94, 0.14); border: 1px solid rgba(244, 63, 94, 0.3); }
.hor-status.off { color: var(--muted); background: rgba(255,255,255,0.06); border: 1px solid var(--line); }

.row-toggle { display: flex; align-items: center; gap: 16px; justify-content: space-between; }
.row-toggle .grow { min-width: 0; }
.row-toggle .row-title { font-size: 14px; font-weight: 650; }
.row-toggle .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.switch { position: relative; display: inline-block; width: 50px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #2a2e55; border-radius: 999px; transition: background .2s ease, box-shadow .2s ease;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.switch .slider::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 4px; top: 4px;
  background: #fff; border-radius: 50%; transition: transform .2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.switch input:checked + .slider { background: linear-gradient(135deg, var(--acc), var(--acc2)); box-shadow: 0 0 16px rgba(34, 211, 238, 0.35); }
.switch input:checked + .slider::before { transform: translateX(22px); }
.switch input:focus + .slider { box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.25); }

#hor-body { margin-top: 18px; }
#hor-body.disabled { opacity: 0.45; pointer-events: none; }

.days-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.days-pick button {
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
  border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .12s ease;
}
.days-pick button:hover { border-color: var(--acc2); }
.days-pick button.on {
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  border-color: transparent;
  color: #06071a;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(34, 211, 238, 0.35);
}

.time-row { display: flex; gap: 16px; flex-wrap: wrap; }
.time-row > div { flex: 1; min-width: 140px; }
.time-row input[type="time"] { width: 100%; }

.form-error { margin-top: 12px; color: #ff8b84; font-size: 13px; font-weight: 600; }
.form-error.hidden { display: none; }

/* ---------- ÚLTIMAS ACTIVIDADES (GALERÍA) ---------- */
.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  max-height: 66vh;
  overflow-y: auto;
  padding-right: 4px;
}
.act-item {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: border-color .12s ease, transform .12s ease;
}
.act-item:hover { border-color: var(--acc2); transform: translateY(-2px); }
.act-item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #000; display: block; }
.act-meta { padding: 6px 8px; }
.act-url { font-size: 11px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-time { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* ---------- VISOR PANTALLA COMPLETA ---------- */
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.93); display: flex; align-items: center; justify-content: center; }
.lightbox.hidden { display: none; }
.lb-img { max-width: calc(100vw - 220px); max-height: calc(100vh - 170px); object-fit: contain; border-radius: 6px; box-shadow: 0 12px 44px rgba(0,0,0,0.6); background: #000; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 58px; height: 92px; border: 0; border-radius: 10px;
  background: rgba(255,255,255,0.08); color: #fff; font-size: 42px; line-height: 1;
  cursor: pointer; transition: background .12s ease;
}
.lb-nav:hover { background: rgba(255,255,255,0.2); }
.lb-nav:disabled { opacity: 0.22; cursor: default; }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb-close {
  position: absolute; top: 16px; right: 20px; z-index: 2;
  width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,0.1); color: #fff; font-size: 18px; cursor: pointer;
}
.lb-close:hover { background: rgba(255,255,255,0.22); }
.lb-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  padding: 16px 22px 18px;
  background: linear-gradient(0deg, rgba(0,0,0,0.9), rgba(0,0,0,0));
}
.lb-info { min-width: 0; }
.lb-url { color: #fff; font-size: 13px; word-break: break-all; }
.lb-time { color: #9aa3b0; font-size: 12px; margin-top: 4px; }

.yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 8px; }
.yt-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(99, 102, 241, 0.08), rgba(34, 211, 238, 0.03) 70%, var(--bg3));
  font-size: 13px;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.yt-item:hover { border-color: var(--acc2); transform: translateY(-1px); }
.yt-item .switch { width: 42px; height: 24px; }
.yt-item .switch input:checked + .slider::before { transform: translateX(18px); }

/* GUARD: YouTube bloqueado por categoría */
.cat-guard {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.14), rgba(244, 63, 94, 0.08));
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 12px 0 16px;
}
.cat-guard-msg { font-weight: 700; font-size: 13.5px; color: #fcd34d; margin-bottom: 6px; }
.cat-guard .hint { margin-top: 4px; }
.cat-guard .btn { margin-top: 10px; }

/* PERMISOS */
.perms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 8px; }
.perm-item { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(150deg, rgba(255,255,255,0.02), var(--bg3)); font-size: 13px; cursor: pointer; transition: border-color 0.2s ease; }
.perm-item:hover { border-color: var(--acc2); }
.perm-item input { width: 16px; height: 16px; accent-color: var(--acc); }
#aj-perms-wrap { margin: 10px 0 14px; }
#aj-perms-wrap > label { font-size: 13px; color: var(--muted); }
.select, select {
  background: var(--bg3); color: var(--txt); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 10px; font-size: 13px;
}
.switch.big { width: 60px; height: 34px; }
.switch.big input:checked + .slider::before { transform: translateX(26px); }

/* CENTRO DE AYUDA */
.help-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 900;
  width: 54px; height: 54px; border-radius: 50%; border: 0;
  background: linear-gradient(135deg, var(--acc), var(--acc2)); color: #06071a; font-size: 24px; font-weight: 700;
  cursor: pointer; box-shadow: 0 10px 30px rgba(99, 102, 241, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.help-fab:hover { transform: scale(1.08); box-shadow: 0 14px 40px rgba(34, 211, 238, 0.5); }
.help-list { max-height: 44vh; overflow-y: auto; margin: 14px 0 4px; }
.help-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.02), var(--bg3));
  margin-bottom: 8px;
  padding: 10px 12px;
  transition: border-color 0.2s ease;
}
.help-item:hover { border-color: var(--acc2); }
.help-item summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.help-item .help-answer { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.5; }
#modal-help .card input, #modal-help .card textarea {
  width: 100%; background: var(--bg3); color: var(--txt); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 10px; font-size: 13px; font-family: inherit; margin-top: 8px;
}
#help-search { margin-bottom: 12px; }


/* CLASES / GOOGLE CLASSROOM */
.cl-groups { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.cl-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(160deg, rgba(99, 102, 241, 0.08), rgba(34, 211, 238, 0.03) 70%, var(--bg2));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.cl-card:hover { border-color: var(--acc2); transform: translateY(-1px); }
.cl-card-main { min-width: 0; }
.cl-card-name { font-weight: 600; font-size: 14px; }
.cl-card-actions { display: flex; gap: 8px; flex-shrink: 0; }

.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.live-card {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.03), var(--bg2));
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.live-card:hover { border-color: var(--acc2); transform: translateY(-2px); box-shadow: 0 14px 34px rgba(34, 211, 238, 0.12); }
.live-card.off { opacity: 0.55; }
.live-thumb { aspect-ratio: 16 / 10; background: var(--bg3); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.live-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-off { color: var(--muted); font-size: 12px; }
.live-name { padding: 8px 10px 0; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-sub { padding: 2px 10px 0; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-card .live-sub:last-child { padding-bottom: 12px; }
.live-sub.offline { color: var(--warn); }

/* Pestañas abiertas de cada alumno (solo visible para el profesor) */
.student-tabs { border-top: 1px solid var(--line); padding: 8px 8px 10px; cursor: default; }
.st-tabs-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 10px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase;
  color: var(--muted); padding: 2px 3px 6px;
}
.st-tabs-count { background: rgba(148,163,184,.18); border-radius: 20px; padding: 1px 7px; }
.st-tabs-age { font-size: 9.5px; color: var(--muted); padding: 0 3px 5px; }
.st-tabs-age.warn { color: var(--warn); }
.st-tab-row, .st-filter-row {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: 1px solid transparent; border-radius: 9px; background: transparent;
  color: var(--txt); padding: 6px 7px; margin-bottom: 3px; cursor: pointer;
}
.st-tab-row:hover, .st-filter-row:hover { background: rgba(148,163,184,.12); border-color: var(--line); }
.st-tab-row.active { background: rgba(34,211,238,.10); border-color: rgba(34,211,238,.35); }
.st-tab-ico {
  width: 18px; height: 18px; flex: 0 0 auto; border-radius: 5px; font-size: 9px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; color: #fff; background: #64748b;
}
.st-tab-body { min-width: 0; flex: 1; }
.st-tab-title { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tab-sub { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tab-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; flex: 0 0 auto; }
.st-filter-row { border-color: rgba(34,211,238,.45); background: linear-gradient(120deg, rgba(34,211,238,.12), rgba(99,102,241,.08)); }
.st-filter-ico { width: 18px; height: 18px; flex: 0 0 auto; border-radius: 5px; background: rgba(34,211,238,.18); color: var(--acc2); display: flex; align-items: center; justify-content: center; font-size: 10px; }
.st-filter-title { font-size: 9px; font-weight: 800; letter-spacing: .8px; color: var(--acc2); }
.st-filter-name { font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-filter-time { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-empty { font-size: 11px; color: var(--muted); padding: 4px 3px; }
.sf-card { text-align: center; max-width: 420px; }
.sf-eyebrow { font-size: 10px; font-weight: 800; letter-spacing: 1.4px; color: var(--acc2); }
.sf-card h3 { font-size: 18px; margin: 4px 0 8px; }
.sf-clock { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .5px; margin-bottom: 8px; }
.sf-card .actions { justify-content: center; flex-wrap: wrap; }

/* Tira horizontal de favicons de las pestañas del alumno */
.st-fav-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 5px 6px 7px; }
.st-fav {
  position: relative; width: 30px; height: 30px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 8px; padding: 0;
  background: rgba(148,163,184,.10); cursor: pointer; overflow: visible;
  display: flex; align-items: center; justify-content: center;
}
.st-fav:hover { border-color: var(--acc2); background: rgba(34,211,238,.14); transform: translateY(-1px); }
.st-fav-letter {
  position: absolute; inset: 5px; border-radius: 5px; color: #fff;
  font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.st-fav-img { position: relative; width: 18px; height: 18px; object-fit: contain; }
.st-fav-tip {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  z-index: 30; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis;
  background: #0f172a; color: #f8fafc; border: 1px solid var(--line); border-radius: 7px;
  padding: 5px 8px; font-size: 11px; font-weight: 500; box-shadow: 0 8px 20px rgba(0,0,0,.35);
  pointer-events: none;
}
.st-fav:hover .st-fav-tip { display: block; }
.ta-card { position: relative; max-width: 460px; }
.ta-question { font-size: 14px; font-weight: 700; margin: 12px 0 4px; }
.ta-x {
  position: absolute; top: 8px; right: 10px; width: 28px; height: 28px;
  border: 1px solid var(--line); border-radius: 8px; background: transparent;
  color: var(--muted); font-size: 13px; cursor: pointer;
}
.ta-x:hover { color: var(--txt); border-color: var(--acc2); }

.cl-filter-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(34, 211, 238, 0.45);
  background: linear-gradient(120deg, rgba(34, 211, 238, 0.14), rgba(99, 102, 241, 0.10) 60%, var(--bg2));
  box-shadow: 0 12px 30px rgba(34, 211, 238, 0.10);
}
.cl-filter-card.hidden { display: none; }
.cl-filter-main { min-width: 0; }
.cl-filter-eyebrow { font-size: 10px; font-weight: 800; letter-spacing: 1.4px; color: var(--acc2); }
.cl-filter-name { font-size: 15px; font-weight: 700; margin: 2px 0 1px; }
.cl-filter-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cl-filter-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Modo «Atención Porfavor» */
.cl-attention-card {
  border-color: rgba(251, 191, 36, 0.55);
  background: linear-gradient(120deg, rgba(251, 191, 36, 0.16), rgba(244, 63, 94, 0.10) 60%, var(--bg2));
  box-shadow: 0 12px 30px rgba(251, 191, 36, 0.10);
}
.cl-attention-card .cl-filter-eyebrow { color: var(--warn); }
.at-modal { max-width: 520px; }
.at-options { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 16px; }
.at-option {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  background: rgba(148,163,184,.08); color: var(--txt); cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.at-option:hover { border-color: var(--acc2); background: rgba(34,211,238,.10); transform: translateY(-1px); }
.at-option.selected { border-color: var(--warn); background: rgba(251,191,36,.14); box-shadow: 0 0 0 1px rgba(251,191,36,.4) inset; }
.at-opt-ico { font-size: 26px; flex: 0 0 auto; }
.at-opt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.at-opt-title { font-size: 14px; font-weight: 800; }
.at-opt-desc { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.demo-strip {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 16px;
  font-size: 12.5px;
  color: #0b1220;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
}
.demo-strip.hidden { display: none; }
.demo-strip .btn { border-color: rgba(0, 0, 0, 0.35); color: #0b1220; background: rgba(255, 255, 255, 0.35); }
.demo-strip .btn:hover { background: rgba(255, 255, 255, 0.6); }
.clf-durations { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.clf-durations .btn { min-width: 74px; }
@media (max-width: 620px) {
  .cl-filter-card { flex-direction: column; align-items: flex-start; }
}

.msg-panel textarea { width: 100%; margin-top: 8px; background: var(--bg3); border: 1px solid var(--line); border-radius: 10px; color: var(--txt); padding: 10px 12px; font-family: inherit; font-size: 13px; resize: vertical; }

.pick-row { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--txt); cursor: pointer; font-size: 14px; }
.pick-row:hover:not(:disabled) { border-color: var(--acc2); background: var(--bg3); }
.pick-row:disabled { opacity: 0.5; cursor: default; }
.pick-title { font-weight: 600; }
.pick-row .sub { font-size: 12px; color: var(--muted); }

.gc-count { font-size: 12px; color: var(--acc2); background: rgba(56,189,248,0.12); border-radius: 999px; padding: 2px 8px; margin-left: 6px; white-space: nowrap; }
.gc-count.zero { color: var(--warn); background: rgba(245,158,11,0.14); }

/* ESTADÍSTICAS DEL ALUMNO */
.stat-wrap { display: flex; flex-direction: column; gap: 16px; }
.stat-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat-chip {
  background: linear-gradient(150deg, rgba(34, 211, 238, 0.1), rgba(99, 102, 241, 0.05) 70%, var(--bg3));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.stat-chip:hover { border-color: var(--acc2); transform: translateY(-1px); }
.stat-chip .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); display: block; font-weight: 600; }
.stat-chip .v { font-size: 22px; font-weight: 800; line-height: 1.25; background: linear-gradient(135deg, #fff, #b3b8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-chip .v small { font-size: 12px; font-weight: 500; color: var(--muted); }
.stat-block-title { font-size: 12px; font-weight: 700; color: var(--acc2); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.4px; }
.stat-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.stat-list { display: flex; flex-direction: column; gap: 7px; }
.stat-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.stat-row .host { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-row .n { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-bar { height: 7px; border-radius: 999px; background: var(--bg3); overflow: hidden; flex: 1; min-width: 50px; }
.stat-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc2)); border-radius: 999px; }
.stat-days { display: flex; align-items: flex-end; gap: 6px; height: 84px; }
.stat-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.stat-day .col { width: 100%; max-width: 34px; background: linear-gradient(180deg, var(--acc2), var(--acc)); border-radius: 5px 5px 0 0; min-height: 2px; }
.stat-day .col.zero { background: var(--bg3); }
.stat-day .d { font-size: 10px; color: var(--muted); white-space: nowrap; }
.stat-day .n { font-size: 10.5px; font-weight: 600; }

/* BLOQUEO DE YOUTUBE */
.ytb-opts { display: flex; flex-direction: column; gap: 8px; background: var(--bg3); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.ytb-sub { opacity: 0.55; pointer-events: none; }
.ytb-sub.on { opacity: 1; pointer-events: auto; }
.ytb-head { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.ytb-tools2 { display: flex; gap: 8px; margin-bottom: 10px; }
.ytb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; margin-top: 10px; }
.ytb-card {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.03), var(--bg2));
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
}
.ytb-card:hover { border-color: var(--acc2); transform: translateY(-3px); box-shadow: 0 14px 34px rgba(34, 211, 238, 0.14); }
.ytb-card.sel { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger) inset; }
.ytb-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #000; }
.ytb-t { padding: 7px 9px 0; font-size: 11.5px; line-height: 1.35; height: 3.6em; overflow: hidden; color: var(--txt); }
.ytb-x { padding: 4px 9px 9px; font-size: 11px; font-weight: 600; color: var(--muted); }
.ytb-card.sel .ytb-x { color: var(--danger); }

/* TEMA CLARO */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f8fafc;
  --bg2: #eef2f7;
  --bg3: #e2e8f0;
  --line: #cbd5e1;
  --txt: #0f172a;
  --muted: #475569;
  --acc: #4f46e5;
  --acc2: #0891b2;
}
html[data-theme="light"] body {
  background:
    radial-gradient(1000px 520px at 88% -12%, rgba(8, 145, 178, 0.12), transparent 58%),
    radial-gradient(860px 460px at 4% 0%, rgba(79, 70, 229, 0.12), transparent 55%),
    var(--bg);
  color: var(--txt);
}
html[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
html[data-theme="light"] .brand.small,
html[data-theme="light"] .logo-text { color: var(--txt); }
html[data-theme="light"] .topbar nav {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .topbar nav a:hover { background: rgba(15, 23, 42, 0.06); color: var(--txt); }
html[data-theme="light"] .card-stat .n {
  background: linear-gradient(135deg, #0f172a, #4f46e5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme="light"] .auth-card {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--line);
}
html[data-theme="light"] .auth-overlay {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.75) 0%, rgba(241, 245, 249, 0.45) 100%);
}
html[data-theme="light"] .form-section input,
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #ffffff;
  color: var(--txt);
  border-color: var(--line);
}
html[data-theme="light"] .form-section input::placeholder,
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: #94a3b8; }
html[data-theme="light"] .form-section input:focus,
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus { background: #ffffff; }
html[data-theme="light"] .logout-btn {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
  color: #b91c1c;
}
html[data-theme="light"] .logout-btn:hover { background: rgba(239, 68, 68, 0.2); color: #7f1d1d; }

/* PESTAÑAS SOSPECHOSAS, NOTAS Y AVISOS EN «VER PANTALLA» */
.st-fav.suspicious { border-color: rgba(239, 68, 68, .75); background: rgba(239, 68, 68, .14); animation: st-susp 1.8s ease-in-out infinite; }
@keyframes st-susp { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.35); } 50% { box-shadow: 0 0 0 4px rgba(239,68,68,.08); } }
.live-warn {
  margin: 6px 8px 0; padding: 4px 7px; border-radius: 8px;
  background: rgba(245, 158, 11, .16); color: var(--warn);
  font-size: 10.5px; font-weight: 700; text-align: left;
}
.live-note {
  margin: 4px 8px 0; padding: 4px 7px; border-radius: 8px;
  background: rgba(253, 230, 138, .16); color: #fde68a;
  font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left;
}
html[data-theme="light"] .live-note { color: #92400e; }
.cl-security {
  margin-top: 14px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid rgba(239, 68, 68, .4); background: rgba(239, 68, 68, .08);
}
.cl-security.hidden { display: none; }
.sec-title { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #f87171; margin-bottom: 7px; }
.sec-item { font-size: 12px; line-height: 1.5; padding: 4px 0; border-top: 1px solid rgba(239, 68, 68, .15); }
.sec-item:first-of-type { border-top: 0; }
.sec-item span { color: var(--muted); }
.sec-item small { color: var(--muted); font-size: 10.5px; }
.stat-alerts {
  margin-top: 4px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, .4); background: rgba(245, 158, 11, .09);
  color: var(--warn); font-size: 12px; line-height: 1.6;
}
.stat-alerts b { display: block; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; margin-bottom: 4px; }

/* CAMPOS DEL MODO ATENCIÓN Y MODALES DE NOTA / MENSAJE */
.at-extra { display: grid; grid-template-columns: 1fr 2fr; gap: 8px 12px; margin: 12px 0 4px; align-items: center; }
.at-extra label { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.at-extra input {
  width: 100%; background: var(--bg3); border: 1px solid var(--line); border-radius: 9px;
  color: var(--txt); padding: 8px 10px; font-family: inherit; font-size: 13px;
}
.at-modal textarea {
  width: 100%; margin-top: 8px; background: var(--bg3); border: 1px solid var(--line);
  border-radius: 10px; color: var(--txt); padding: 10px 12px; font-family: inherit;
  font-size: 13px; resize: vertical;
}
@media (max-width: 620px) { .at-extra { grid-template-columns: 1fr; } }

/* SEGURIDAD: AUDITORÍA, RESUMEN Y CAMBIO DE CONTRASEÑA DEL ADMIN */
.notice {
  margin-bottom: 16px; padding: 13px 16px; border-radius: 12px;
  background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .45);
  color: var(--txt); font-size: 13px; line-height: 1.5;
}
.notice a { color: var(--acc2); font-weight: 700; }
.notice .sub { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.audit-chain { margin-bottom: 12px; padding: 9px 12px; border-radius: 9px; font-size: 12px; font-weight: 700; }
.audit-chain.ok { background: rgba(34, 197, 94, .12); color: #16a34a; }
.audit-chain.bad { background: rgba(239, 68, 68, .12); color: #dc2626; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th, .table td { padding: 8px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; word-break: break-word; }
.table th { color: var(--muted); font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; }
.table tr:last-child td { border-bottom: 0; }
.admin-pwd-box { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; margin-top: 10px; }
.admin-pwd-box .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; width: 100%; }
.admin-pwd-box label { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.admin-pwd-box input {
  width: 100%; background: var(--bg3); border: 1px solid var(--line); border-radius: 9px;
  color: var(--txt); padding: 9px 11px; font-family: inherit; font-size: 13px;
}
.msg { min-height: 18px; font-size: 12.5px; color: var(--muted); }

