:root {
  --bg: #f3f0e8;
  --bg-2: #e8f1ee;
  --ink: #1f2a24;
  --muted: #4f5b55;
  --accent: #2a7f62;
  --accent-2: #d8893b;
  --card: #fffdf8;
  --line: #d7d0c4;
  --shadow: 0 10px 30px rgba(31, 42, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Optima", "Segoe UI", "Candara", "Noto Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 500px at 10% -10%, #f9ede2 0%, transparent 60%),
    radial-gradient(1000px 500px at 90% 0%, #e4f2ef 0%, transparent 60%),
    linear-gradient(120deg, var(--bg) 0%, var(--bg-2) 100%);
  min-height: 100vh;
}

header {
  padding: 28px 24px 12px;
}

h1, h2, h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  margin: 0 0 8px;
  letter-spacing: 0.2px;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 22px;
}

p {
  margin: 0 0 10px;
  color: var(--muted);
}

main {
  padding: 0 24px 48px;
  max-width: 1680px;
  margin: 0 auto;
}

body[data-page="cursos"] main {
  max-width: 1680px;
}

body[data-page="cursos"] .split {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 22px;
}

body[data-page="cursos"] #cursos-list,
body[data-page="cursos"] #estudiantes-list {
  max-height: calc(100vh - 360px);
  overflow-y: auto;
  padding-right: 6px;
}

@media (max-width: 900px) {
  body[data-page="cursos"] #cursos-list,
  body[data-page="cursos"] #estudiantes-list {
    max-height: none;
  }
}

.nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  border-bottom: 1px solid rgba(215, 208, 196, 0.7);
  padding-bottom: 8px;
}

body[data-page="planClaseDetail"] .nav,
body[data-page="actividadDetail"] .nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(248, 247, 243, 0.95);
  padding: 10px 24px 12px;
  backdrop-filter: blur(6px);
  margin-top: 0;
  border-bottom: 1px solid rgba(215, 208, 196, 0.7);
}

body[data-page="planClaseDetail"] header,
body[data-page="actividadDetail"] header {
  padding-top: 72px;
}

body[data-page="planClaseDetail"] main,
body[data-page="actividadDetail"] main {
  padding-top: 6px;
  max-width: min(1800px, calc(100vw - 24px));
}

.nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 14px 14px 0 0;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  border-bottom-color: transparent;
  position: relative;
  top: 1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-icon {
  font-size: 1.05em;
  line-height: 1;
}

.nav a.active {
  background: #fffdf8;
  border-color: rgba(215, 208, 196, 0.9);
  border-bottom-color: #fffdf8;
  box-shadow: 0 -6px 18px rgba(90, 76, 56, 0.12);
  font-weight: 600;
}

.hero {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 10px;
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(215, 208, 196, 0.7);
}

.card.highlight {
  border-left: 6px solid var(--accent);
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.list li {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.course-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(215, 208, 196, 0.9);
  background: #fff;
}

.course-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.list a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.row > * {
  flex: 1;
}

.row button {
  flex: 0 0 auto;
}

.icon-button {
  padding: 8px;
  min-width: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.course-meta > div {
  display: grid;
  gap: 4px;
}

.guardian-landing {
  margin-bottom: 18px;
}

.guardian-hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: 18px;
  align-items: start;
}

.guardian-status-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(215, 208, 196, 0.8);
  background: linear-gradient(135deg, rgba(232, 241, 238, 0.9), rgba(249, 237, 226, 0.92));
}

.guardian-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0 18px;
}

.guardian-check input {
  margin-top: 2px;
}

@media (max-width: 720px) {
  .guardian-hero {
    grid-template-columns: 1fr;
  }
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.helper {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.camera-capture {
  margin-top: 8px;
}

.camera-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.camera-preview {
  margin-top: 8px;
  width: min(100%, 260px);
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #111;
}

.wizard {
  display: grid;
  gap: 16px;
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.wizard-progress {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.wizard-route {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(31, 42, 36, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s ease;
}

.wizard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.step-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.step-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.wizard-step.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.grid-2 {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid-3 {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.template-builder {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.6);
}

.section-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.85);
}

.template-builder h2 {
  margin-top: 0;
}

.subactivity-builder {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.subactivity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.subactivity-list {
  display: grid;
  gap: 10px;
}

.subactivity-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.9);
}

.video-panel {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #f8fafc;
}

.video-preview {
  margin-top: 10px;
}

.video-subpanel {
  margin-top: 10px;
}

.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
}

.video-embed iframe,
.video-embed video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-fallback {
  color: #f8fafc;
  padding: 16px;
}

.audio-embed {
  padding: 12px;
  border-radius: 12px;
  background: #f1f5f9;
}

.audio-embed audio {
  width: 100%;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-top-color: rgba(255, 255, 255, 1);
  border-radius: 999px;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

.button.loading {
  opacity: 0.8;
  pointer-events: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.subactivity-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.subactivity-card.draggable {
  cursor: grab;
}

.subactivity-card.dragging {
  opacity: 0.6;
  border-style: dashed;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #5a6b63;
  cursor: grab;
}

.slides-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

.slides-body .slide {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.slide-lluvia-access {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(42, 127, 98, 0.08);
  display: grid;
  gap: 6px;
}

.slide-lluvia-access a {
  word-break: break-all;
}

.slide-activity-code-access {
  background: rgba(18, 31, 38, 0.06);
}

.activity-code-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px dashed rgba(28, 88, 116, 0.38);
  border-radius: 12px;
  background: #fff;
  color: #16313a;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.activity-code-copy:hover,
.activity-code-copy:focus-visible {
  border-color: #1d6fd6;
  box-shadow: 0 10px 24px rgba(29, 111, 214, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.activity-code-copy-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.activity-code-copy-hint {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.slide-lluvia-embed-wrap {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.slide-lluvia-embed {
  width: 100%;
  height: min(52vh, 520px);
  border: 0;
  display: block;
}

#plan-clase-notebook {
  padding: 0;
}

#plan-clase-notebook .fullscreen-content.notebook-fullscreen-content {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 52%),
    linear-gradient(145deg, #d8c8aa 0%, #c5b390 55%, #b69f7a 100%);
}

.notebook-controls {
  margin-bottom: 10px;
}

.notebook-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 20px;
  padding: 26px 24px 24px 54px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.38));
  box-shadow: inset 0 0 0 1px rgba(70, 50, 24, 0.22), 0 16px 30px rgba(58, 40, 16, 0.24);
}

.notebook-binding {
  position: absolute;
  left: 18px;
  top: 22px;
  bottom: 22px;
  width: 22px;
  border-radius: 12px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(70, 52, 28, 0.8) 0,
    rgba(70, 52, 28, 0.8) 9px,
    rgba(255, 255, 255, 0.7) 9px,
    rgba(255, 255, 255, 0.7) 18px
  );
  opacity: 0.8;
}

.notebook-body {
  height: 100%;
  perspective: 1400px;
}

.notebook-page {
  height: 100%;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(66, 103, 178, 0.18) 0,
      rgba(66, 103, 178, 0.18) 1px,
      transparent 1px,
      transparent 34px
    ),
    #fffef6;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(70, 50, 24, 0.22);
  padding: 26px;
  overflow: auto;
  transform-style: preserve-3d;
}

.notebook-page .slide {
  background: transparent;
  border-radius: 0;
  padding: 0;
}

#plan-clase-slides:fullscreen .fullscreen-content,
#plan-clase-slides:-webkit-full-screen .fullscreen-content {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

#plan-clase-slides:fullscreen .slides-controls,
#plan-clase-slides:-webkit-full-screen .slides-controls {
  margin-bottom: 6px;
}

#plan-clase-slides:fullscreen .slides-body,
#plan-clase-slides:-webkit-full-screen .slides-body {
  flex: 1;
  min-height: 0;
  margin-top: 0;
  padding: 6px;
}

#plan-clase-slides:fullscreen .slides-body .slide,
#plan-clase-slides:-webkit-full-screen .slides-body .slide {
  height: 100%;
  min-height: 100%;
  padding: 12px;
}

#plan-clase-slides:fullscreen .video-embed,
#plan-clase-slides:-webkit-full-screen .video-embed,
#plan-clase-notebook:fullscreen .video-embed,
#plan-clase-notebook:-webkit-full-screen .video-embed {
  height: 78dvh;
}

#plan-clase-slides:fullscreen .slide-lluvia-embed,
#plan-clase-slides:-webkit-full-screen .slide-lluvia-embed,
#plan-clase-notebook:fullscreen .slide-lluvia-embed,
#plan-clase-notebook:-webkit-full-screen .slide-lluvia-embed {
  height: 74dvh;
}

#plan-clase-slides:fullscreen .slide-body img,
#plan-clase-slides:-webkit-full-screen .slide-body img,
#plan-clase-notebook:fullscreen .slide-body img,
#plan-clase-notebook:-webkit-full-screen .slide-body img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 78dvh;
  object-fit: contain;
  margin: 8px auto;
}

#plan-clase-notebook:fullscreen .fullscreen-content.notebook-fullscreen-content,
#plan-clase-notebook:-webkit-full-screen .fullscreen-content.notebook-fullscreen-content {
  padding: 12px;
}

#plan-clase-notebook:fullscreen .notebook-stage,
#plan-clase-notebook:-webkit-full-screen .notebook-stage {
  padding: 12px 10px 10px 34px;
}

#plan-clase-notebook:fullscreen .notebook-page,
#plan-clase-notebook:-webkit-full-screen .notebook-page {
  padding: 14px;
}

.notebook-page.turn-next {
  transform-origin: left center;
  animation: notebookTurnNext 420ms ease;
}

.notebook-page.turn-prev {
  transform-origin: right center;
  animation: notebookTurnPrev 420ms ease;
}

@keyframes notebookTurnNext {
  0% { transform: rotateY(0deg); opacity: 1; }
  45% { transform: rotateY(-18deg); opacity: 0.92; }
  100% { transform: rotateY(0deg); opacity: 1; }
}

@keyframes notebookTurnPrev {
  0% { transform: rotateY(0deg); opacity: 1; }
  45% { transform: rotateY(18deg); opacity: 0.92; }
  100% { transform: rotateY(0deg); opacity: 1; }
}

.rich-editor {
  min-height: 110px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow-wrap: anywhere;
}

.rich-editor img,
.editor img,
.editor-inline img {
  display: block;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  margin: 8px auto;
}

.mini-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.mini-toolbar .button {
  padding: 6px 10px;
  font-size: 12px;
}

.slide-body {
  font-size: 18px;
  line-height: 1.6;
}

.lluvia-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 16px;
  margin-top: 12px;
}

.lluvia-qr img {
  width: 180px;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.scanner-video {
  margin-top: 16px;
  background: #0f172a;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.25);
  padding: 12px;
  display: grid;
  place-items: center;
  min-height: 320px;
}

#plickers-video {
  width: 100%;
  max-width: 720px;
  border-radius: 12px;
}

#plickers-canvas {
  display: none;
}

.scanner-mobile-page main {
  max-width: 860px;
}

.scanner-mobile-shell {
  display: grid;
  gap: 14px;
}

.scanner-mobile-controls {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scanner-mobile-video {
  margin-top: 2px;
  background: #0f172a;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.25);
  padding: 10px;
}

#scanner-movil-video {
  width: 100%;
  border-radius: 10px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

#scanner-movil-canvas {
  display: none;
}

.scanner-mobile-manual {
  display: grid;
  gap: 8px;
}

.scanner-mobile-answer-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.scanner-mobile-answer-grid .button {
  min-height: 46px;
  font-size: 18px;
  font-weight: 700;
}

.scanner-mobile-feed h2 {
  margin-bottom: 10px;
}

@media (max-width: 760px) {
  .scanner-mobile-controls {
    grid-template-columns: 1fr;
  }

  .scanner-mobile-answer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.plickers-link {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 40;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  max-width: 320px;
  font-size: 12px;
}

.plickers-link-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.plickers-link-title {
  font-weight: 700;
}

.plickers-link-toggle {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
}

.plickers-link-body {
  margin-top: 6px;
}

.plickers-link-url {
  display: inline-block;
  word-break: break-all;
  color: var(--primary);
  text-decoration: none;
}

.plickers-link-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.plickers-link-config {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.plickers-link-config input {
  flex: 1;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 12px;
}

.plickers-link-config button {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}

.plickers-link.minimized {
  max-width: 220px;
}

.plickers-link.minimized .plickers-link-body {
  display: none;
}

.flashcards-card {
  background: linear-gradient(135deg, #f8fbff, #eef5ff);
  position: relative;
  overflow: hidden;
}

.flashcards-stage {
  min-height: 320px;
}

.flashcards-options {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.flashcards-answer-controls {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.flashcards-option-correct {
  border-color: #39ff14 !important;
  background: #39ff14 !important;
  color: #052b00 !important;
  box-shadow: 0 0 0 2px rgba(57, 255, 20, 0.45), 0 0 24px rgba(57, 255, 20, 0.55) !important;
}

.flashcards-option-correct strong {
  color: #052b00 !important;
  font-weight: 800;
}

.flashcards-option-selected {
  border-color: #2a73ff !important;
  background: #dce9ff !important;
  color: #10356f !important;
}

.flashcards-option-selected strong {
  color: #10356f !important;
}

.flashcards-option {
  justify-content: flex-start;
  text-align: left;
  gap: 10px;
  white-space: normal;
  line-height: 1.35;
}

.flashcards-option strong {
  min-width: 24px;
  display: inline-block;
}

.flashcards-theme-clasica {
  background: linear-gradient(135deg, #f8fbff, #eef5ff);
}

.flashcards-theme-cuaderno {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(197, 69, 140, 0.26) 0,
      rgba(197, 69, 140, 0.26) 3px,
      transparent 3px,
      transparent 58px
    ),
    linear-gradient(165deg, #f5b3dd 0%, #eca7d5 100%);
  border-color: rgba(167, 82, 126, 0.35);
}

.flashcards-theme-cuaderno::before,
.flashcards-theme-cuaderno::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 34px;
  background: rgba(255, 222, 236, 0.65);
}

.flashcards-theme-cuaderno::before {
  top: 14px;
  right: -32px;
  transform: rotate(33deg);
}

.flashcards-theme-cuaderno::after {
  bottom: 18px;
  left: -40px;
  transform: rotate(40deg);
}

.flashcards-theme-neon {
  background: radial-gradient(circle at top left, #21404e, #101924 68%);
  border-color: rgba(94, 255, 235, 0.2);
  box-shadow: inset 0 0 80px rgba(94, 255, 235, 0.1), 0 12px 30px rgba(9, 16, 24, 0.6);
}

.flashcards-theme-minimal {
  background: linear-gradient(180deg, #fbfbfc 0%, #f2f4f8 100%);
  border-color: rgba(125, 137, 156, 0.35);
}

.flashcards-theme-fichero {
  background:
    linear-gradient(90deg, rgba(189, 161, 113, 0.42) 0 4px, transparent 4px 100%),
    linear-gradient(180deg, #fcf2dc 0%, #f8e8c9 100%);
  border-color: rgba(177, 146, 96, 0.45);
}

.flashcards-theme-neon #flashcards-question,
.flashcards-theme-neon .flashcards-option,
.flashcards-theme-neon .flashcards-option strong {
  color: #e6fff9;
}

.flashcards-theme-neon .flashcards-option {
  background: rgba(25, 34, 46, 0.7);
  border-color: rgba(94, 255, 235, 0.25);
}

.flashcards-theme-cuaderno #flashcards-question,
.flashcards-theme-cuaderno .flashcards-option,
.flashcards-theme-fichero #flashcards-question,
.flashcards-theme-fichero .flashcards-option {
  color: #221c24;
}

.flashcards-theme-cuaderno .flashcards-option,
.flashcards-theme-fichero .flashcards-option {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(90, 73, 98, 0.2);
}

.flashcards-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.flashcards-count {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
}

body[data-page="flashcards"][data-mode="student"] .brand-logo,
body[data-page="flashcards"][data-mode="student"] .nav,
body[data-page="flashcards"][data-mode="student"] .flashcards-toolbar,
body[data-page="flashcards"][data-mode="student"] .flashcards-live {
  display: none;
}

body[data-page="flashcards"][data-mode="student"] header {
  padding-bottom: 4px;
}

body[data-page="flashcards"][data-mode="student"] main {
  padding-top: 8px;
}

body[data-page="flashcards"][data-mode="proy"] {
  min-height: 100dvh;
  overflow: hidden;
  background: radial-gradient(1200px 680px at 8% -20%, #e9dac0 0%, transparent 60%),
    radial-gradient(1200px 700px at 98% 10%, #d8e7ef 0%, transparent 60%),
    linear-gradient(135deg, #ecdfc7 0%, #d6c5ab 55%, #d3e3ea 100%);
}

body[data-page="flashcards"][data-mode="proy"] header {
  padding: 10px 14px 8px;
}

body[data-page="flashcards"][data-mode="proy"] .brand-logo,
body[data-page="flashcards"][data-mode="proy"] .nav,
body[data-page="flashcards"][data-mode="proy"] #flashcards-helper,
body[data-page="flashcards"][data-mode="proy"] .flashcards-auth {
  display: none;
}

body[data-page="flashcards"][data-mode="proy"] h1 {
  font-size: clamp(22px, 2.1vw, 32px);
  margin: 0;
}

body[data-page="flashcards"][data-mode="proy"] main {
  max-width: none;
  width: 100vw;
  height: calc(100dvh - 78px);
  padding: 0 14px 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
}

body[data-page="flashcards"][data-mode="proy"] .flashcards-toolbar {
  margin: 0;
  padding: 12px;
}

body[data-page="flashcards"][data-mode="proy"] .flashcards-toolbar .row {
  gap: 8px;
}

body[data-page="flashcards"][data-mode="proy"] .flashcards-toolbar input {
  display: none;
}

body[data-page="flashcards"][data-mode="proy"] .flashcards-stage {
  margin: 0;
  padding: clamp(18px, 2.8vw, 34px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body[data-page="flashcards"][data-mode="proy"] #flashcards-question {
  font-size: clamp(32px, 4.5vw, 64px);
  line-height: 1.12;
  margin: 0 0 clamp(18px, 2.2vh, 28px);
}

body[data-page="flashcards"][data-mode="proy"] .flashcards-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vh, 18px);
  margin-top: 0;
}

body[data-page="flashcards"][data-mode="proy"] .flashcards-option {
  min-height: clamp(84px, 13vh, 164px);
  font-size: clamp(22px, 2.8vw, 38px);
  font-weight: 600;
  border-width: 2px;
  border-radius: 16px;
  padding: clamp(12px, 1.6vw, 22px);
}

body[data-page="flashcards"][data-mode="proy"] .flashcards-option strong {
  font-size: clamp(20px, 2.2vw, 36px);
  min-width: clamp(28px, 2.4vw, 40px);
}

body[data-page="flashcards"][data-mode="proy"] .flashcards-answer-controls {
  margin-top: 0;
}

body[data-page="flashcards"][data-mode="proy"] .flashcards-live {
  margin: 0;
  padding: 10px 12px;
}

body[data-page="flashcards"][data-mode="proy"] .flashcards-live h3 {
  margin-bottom: 6px;
}

body[data-page="flashcards"][data-mode="proy"] .flashcards-count {
  padding: 10px 12px;
  font-size: clamp(16px, 1.6vw, 24px);
}

@media (max-width: 900px) {
  body[data-page="flashcards"][data-mode="proy"] main {
    height: auto;
    min-height: calc(100dvh - 78px);
  }

  body[data-page="flashcards"][data-mode="proy"] .flashcards-options {
    grid-template-columns: 1fr;
  }
}

.flashcards-preview-modal-card {
  max-width: 760px;
}

.flashcards-visual-editor {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.flashcards-visual-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.flashcards-editor-list {
  display: grid;
  gap: 12px;
}

.flashcards-editor-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(248, 251, 255, 0.92);
  display: grid;
  gap: 12px;
}

.flashcards-editor-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.flashcards-editor-options {
  display: grid;
  gap: 10px;
}

.flashcards-editor-option {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.flashcards-editor-option-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.flashcards-preview-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(248, 251, 255, 0.9);
}

.flashcards-preview-question {
  margin: 0 0 12px;
}

.flashcards-preview-options {
  display: grid;
  gap: 8px;
}

.flashcards-preview-option {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.flashcards-preview-option strong {
  min-width: 18px;
}

.flashcards-preview-option-correct {
  border-color: rgba(42, 127, 98, 0.34);
  background: rgba(42, 127, 98, 0.08);
}

body[data-page="classLive"] {
  min-height: 100dvh;
  background: radial-gradient(1200px 680px at 8% -20%, #e9dac0 0%, transparent 60%),
    radial-gradient(1200px 700px at 98% 10%, #d8e7ef 0%, transparent 60%),
    linear-gradient(135deg, #ecdfc7 0%, #d6c5ab 55%, #d3e3ea 100%);
}

.class-live-main {
  max-width: none;
  width: 100vw;
  min-height: 100dvh;
  margin: 0;
  padding: 12px;
}

.class-live-card {
  margin: 0;
  height: calc(100dvh - 24px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
}

.class-live-toolbar {
  justify-content: space-between;
  gap: 10px;
}

.class-live-stage {
  min-height: 0;
}

.class-live-auth {
  display: grid;
  gap: 8px;
}

.class-live-auth.lock-class #class-live-class-code,
.class-live-auth.lock-class #class-live-class-validate {
  opacity: 0.7;
  pointer-events: none;
}

.class-live-auth:not(.ready-student) #class-live-student-code,
.class-live-auth:not(.ready-student) #class-live-validate {
  opacity: 0.6;
  pointer-events: none;
}

.live-qr-wrap {
  display: flex;
  justify-content: flex-start;
  padding: 8px 0 0;
}

.live-qr-wrap img {
  width: 132px;
  height: 132px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.class-final-summary {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.class-final-summary h3 {
  margin-bottom: 8px;
}

.class-final-summary-list {
  display: grid;
  gap: 8px;
}

.class-final-summary-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.lluvia-input {
  display: grid;
  grid-template-columns: minmax(0, 160px) minmax(0, 1fr) minmax(120px, 160px);
  gap: 10px;
  margin-top: 12px;
}

.lluvia-board {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lluvia-pending {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.lluvia-pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.lluvia-pending-actions {
  display: flex;
  gap: 8px;
}

.lluvia-note {
  background: rgba(42, 127, 98, 0.12);
  color: #1f2a24;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  max-width: 240px;
  box-shadow: 0 4px 12px rgba(31, 42, 36, 0.08);
}

.lluvia-note small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.lluvia-subpanel {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.lluvia-subpanel-body {
  margin-top: 10px;
}

.lluvia-lookup {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.6);
  display: grid;
  gap: 8px;
}

.lluvia-lookup-results {
  display: grid;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.lluvia-lookup-item {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
}

.lluvia-lookup-meta {
  font-size: 12px;
  color: var(--muted);
}

.lluvia-participacion {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.lluvia-participacion .list {
  max-height: 320px;
  overflow-y: auto;
}

.lluvia-participacion-item {
  display: grid;
  gap: 4px;
}

.lluvia-participacion-meta {
  font-size: 12px;
  color: var(--muted);
}

.lluvia-cursos {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.lluvia-cursos-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lluvia-cursos-pick label {
  display: inline-flex;
  align-items: center;
}

.lluvia-curso-chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}

.lluvia-curso-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

@media (max-width: 900px) {
  .lluvia-meta {
    grid-template-columns: 1fr;
  }
  .lluvia-input {
    grid-template-columns: 1fr;
  }
}

/* Lluvia de ideas theme: chalkboard */
.lluvia-theme {
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.25)),
    linear-gradient(135deg, #1f3b2c 0%, #16261e 60%, #122017 100%);
  color: #f8f4ea;
  --lluvia-title-size: 32px;
  --lluvia-hover-scale: 1.06;
}

.lluvia-theme header h1 {
  color: #f6f1e7;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

.lluvia-theme header p {
  color: rgba(255, 255, 255, 0.8);
}

.lluvia-theme .card {
  background: rgba(20, 33, 26, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.lluvia-theme label,
.lluvia-theme .helper,
.lluvia-theme .notice {
  color: rgba(255, 255, 255, 0.82);
}

.lluvia-theme input,
.lluvia-theme textarea,
.lluvia-theme select {
  background: rgba(255, 255, 255, 0.08);
  color: #f8f4ea;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.lluvia-theme .button {
  background: #2d7b5f;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.lluvia-theme .button.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #f8f4ea;
  border-color: rgba(255, 255, 255, 0.3);
}

.lluvia-theme .lluvia-board {
  min-height: 120px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px dashed rgba(255, 255, 255, 0.18);
}

.lluvia-theme #lluvia-titulo,
.lluvia-theme #lluvia-fullscreen-title {
  font-size: var(--lluvia-title-size);
  font-weight: 700;
}

.lluvia-theme .lluvia-input .button {
  padding: 8px 14px;
  font-size: 14px;
  min-width: 140px;
}

.lluvia-theme .lluvia-input input {
  flex: 1 1 auto;
}

.lluvia-theme .lluvia-note {
  background: #f6e7b3;
  color: #2a2417;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
  position: relative;
  padding: 12px 14px 16px;
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", "Georgia", serif;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lluvia-theme .lluvia-note:hover {
  transform: scale(var(--lluvia-hover-scale));
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.35);
}

.lluvia-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.lluvia-controls label {
  font-size: 12px;
  opacity: 0.8;
}

.lluvia-controls input[type="range"] {
  max-width: 180px;
}

.lluvia-theme .lluvia-note::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d97706;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

.lluvia-theme .lluvia-note small {
  color: rgba(42, 36, 23, 0.7);
}

.lluvia-theme.fullscreen {
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.25)),
    linear-gradient(135deg, #1f3b2c 0%, #16261e 60%, #122017 100%);
}

.lluvia-theme.fullscreen .fullscreen-content {
  background: rgba(20, 33, 26, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.lluvia-theme.fullscreen .slides-controls {
  justify-content: space-between;
}

.lluvia-theme.fullscreen .badge,
.lluvia-theme.fullscreen .button.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #f8f4ea;
  border-color: rgba(255, 255, 255, 0.3);
}

.lluvia-theme.fullscreen .lluvia-board {
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  min-height: 240px;
}

.lluvia-theme.fullscreen input {
  background: rgba(255, 255, 255, 0.08);
  color: #f8f4ea;
  border: 1px solid rgba(255, 255, 255, 0.25);
}



.malla-header {
  display: grid;
  gap: 12px;
}

.malla-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.malla-tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.malla-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.malla-table-wrapper {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
}

.malla-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.malla-table th,
.malla-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  vertical-align: top;
  font-size: 12px;
}

.malla-table th {
  background: rgba(42, 127, 98, 0.08);
  text-align: left;
}

.malla-table textarea {
  min-height: 60px;
  font-size: 12px;
}

body[data-page="planClaseDetail"] #plan-clase-table tr,
body[data-page="plan-clase"] #plan-clase-table tr {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

body[data-page="planClaseDetail"] #plan-clase-table tr td,
body[data-page="plan-clase"] #plan-clase-table tr td {
  cursor: pointer;
}

body[data-page="planClaseDetail"] #plan-clase-table tr:hover,
body[data-page="plan-clase"] #plan-clase-table tr:hover {
  background: rgba(42, 127, 98, 0.08);
}

.drag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.drag-chip {
  background: rgba(42, 127, 98, 0.12);
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: grab;
  user-select: none;
}

.drag-chip:active {
  cursor: grabbing;
}

.week-drop {
  border: 2px dashed transparent;
}

.week-drop.drag-over {
  border-color: var(--accent);
  background: rgba(42, 127, 98, 0.06);
}

.activity-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.activity-badge {
  background: rgba(216, 137, 59, 0.12);
  color: #7a4b18;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.activity-badge-remove {
  background: rgba(122, 75, 24, 0.12);
  border: none;
  color: #7a4b18;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  width: 18px;
  height: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.activity-badge-remove:hover {
  background: rgba(122, 75, 24, 0.2);
}

.plan-clase-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-top: 10px;
}

.plan-clase-side {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.attendance-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.attendance-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  max-height: 56vh;
  overflow-y: auto;
  padding-right: 4px;
}

.attendance-modal-card {
  width: min(960px, 96vw);
}

.attendance-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.75);
}

.attendance-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.attendance-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(215, 208, 196, 0.9);
  background: #fff;
  flex: 0 0 auto;
}

.attendance-item-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attendance-item-name strong {
  line-height: 1.2;
}

.attendance-item-meta {
  font-size: 12px;
  color: var(--muted);
}

.attendance-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.attendance-item-actions select,
.attendance-item-actions input {
  min-width: 120px;
}

.attendance-students-list {
  display: grid;
  gap: 8px;
}

.attendance-student-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.78);
}

.attendance-student-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(215, 208, 196, 0.9);
  background: #fff;
}

.attendance-student-name {
  min-width: 0;
}

.attendance-student-name strong {
  display: block;
}

.class-journal-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

#class-journal-card textarea {
  width: 100%;
  resize: vertical;
}

#class-journal-status {
  min-width: 140px;
  text-align: right;
}

.plan-progress-wrapper {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.plan-progress-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.plan-progress-table th,
.plan-progress-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  font-size: 12px;
  text-align: left;
  vertical-align: top;
}

.plan-progress-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f4ee;
}

.plan-progress-table .student-col {
  min-width: 220px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fcfbf8;
}

.plan-progress-table th.student-col {
  z-index: 3;
}

.plan-progress-col-active {
  background: rgba(42, 127, 98, 0.12) !important;
}

.plan-progress-col-subactivity {
  background: rgba(216, 137, 59, 0.12) !important;
}

.plan-progress-cell-done {
  color: var(--accent);
  font-weight: 700;
}

.plan-progress-cell-empty {
  color: var(--muted);
}

.plan-progress-notes {
  min-width: 240px;
}

.plan-progress-note {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.groups-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.group-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(42, 127, 98, 0.1);
  color: var(--ink);
  font-size: 12px;
}

.group-chip.active-filter {
  background: rgba(42, 127, 98, 0.2);
  border: 1px solid rgba(42, 127, 98, 0.28);
}

.button.active-filter {
  background: rgba(42, 127, 98, 0.14);
  border-color: rgba(42, 127, 98, 0.3);
}

.group-chip-individual {
  background: rgba(31, 42, 36, 0.08);
}

.group-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #fff;
  border: 1px solid rgba(215, 208, 196, 0.9);
  overflow: hidden;
  font-size: 14px;
}

.group-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-badge {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(216, 137, 59, 0.14);
  border: 1px solid rgba(216, 137, 59, 0.25);
  margin-right: 8px;
  flex: 0 0 auto;
}

.student-name-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.groups-list,
.groups-assignments {
  display: grid;
  gap: 10px;
}

.groups-assignments {
  max-height: 42vh;
  overflow-y: auto;
  padding-right: 6px;
}

.group-item,
.group-assignment-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.group-assignment-row select {
  min-width: 220px;
}

.group-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#groups-top-section.hidden {
  display: none;
}

.plan-progress-group-row td {
  background: rgba(216, 137, 59, 0.08);
  font-weight: 700;
}

@media (max-width: 900px) {
  .plan-clase-layout {
    grid-template-columns: 1fr;
  }

  .plan-clase-side {
    border-left: none;
    padding-left: 0;
  }

  .attendance-item {
    grid-template-columns: 1fr;
  }

  .attendance-item-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .attendance-item-actions select,
  .attendance-item-actions input {
    width: 100%;
  }

  .class-journal-grid {
    grid-template-columns: 1fr;
  }

  #class-journal-status {
    min-width: 0;
    text-align: left;
  }
}

.split {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.preview {
  position: sticky;
  top: 18px;
  align-self: start;
}

.preview h3 {
  margin-top: 10px;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.sync-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.sync-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.sync-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.sync-backups-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.sync-backup-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.sync-backup-meta {
  display: grid;
  gap: 3px;
}

.sync-backup-name {
  font-weight: 600;
}

.sync-backup-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sync-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.sync-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.sync-grid label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.sync-span-2 {
  grid-column: span 2;
}

.sync-remote-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
  min-height: 56px;
}

.sync-remote-card strong {
  display: block;
  margin-bottom: 4px;
}

@media (max-width: 700px) {
  .sync-span-2 {
    grid-column: span 1;
  }
}

.collapsible {
  position: relative;
}

.collapsible.collapsed {
  max-height: var(--collapsible-max, 12.8em);
  overflow: hidden;
}

.collapsible.collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95));
  pointer-events: none;
}

#actividad-consigna-header-wrap {
  line-height: 1.6;
}

#actividad-consigna-header-wrap.collapsed {
  max-height: none;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#actividad-consigna-header-wrap.collapsed::after {
  display: none;
}

#actividad-consigna-header-wrap p {
  margin: 0 0 0.6em;
}

#actividad-consigna-header-wrap h1,
#actividad-consigna-header-wrap h2,
#actividad-consigna-header-wrap h3,
#actividad-consigna-header-wrap h4,
#actividad-consigna-header-wrap h5,
#actividad-consigna-header-wrap h6 {
  margin: 0 0 0.6em;
}

#actividad-consigna-header-wrap ul,
#actividad-consigna-header-wrap ol {
  margin: 0 0 0.6em 1.2em;
  padding: 0;
}

.collapsed {
  display: none;
}

.preview.hidden {
  display: none;
}

.split.full {
  grid-template-columns: 1fr;
}

.preview h4 {
  margin: 14px 0 6px;
  font-size: 15px;
}

.preview-list {
  gap: 8px;
}

.preview-list li {
  padding: 8px 10px;
  font-size: 14px;
  justify-content: flex-start;
}

.chat-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 320px;
  max-height: 420px;
  min-width: 260px;
  min-height: 280px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr auto;
  z-index: 60;
  resize: both;
  overflow: hidden;
}

.chat-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.chat-body {
  padding: 10px 12px;
  overflow: auto;
  display: grid;
  gap: 8px;
  background: rgba(255, 255, 255, 0.6);
}

.chat-msg {
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  display: block;
}

.chat-msg.user {
  background: rgba(42, 127, 98, 0.12);
  justify-self: end;
}

.chat-msg.ai {
  background: rgba(216, 137, 59, 0.12);
  justify-self: start;
}

.chat-msg-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.chat-msg-body {
  display: grid;
  gap: 6px;
  white-space: pre-wrap;
}

.chat-msg-body p {
  margin: 0;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 10px rgba(31, 42, 36, 0.18);
}

.chat-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.chat-list li {
  margin: 0;
}

.chat-input {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.chat-input textarea {
  min-height: 60px;
}

.chat-typing {
  font-style: italic;
  opacity: 0.8;
}

.chat-msg-files {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.chat-file {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.chat-file img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.chat-attachments {
  display: grid;
  gap: 6px;
}

.chat-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 59;
}

.chat-hidden {
  display: none;
}

.chat-provider {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-provider-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.chat-title .mentor-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(42, 127, 98, 0.12);
  border: 1px solid rgba(31, 42, 36, 0.12);
  overflow: hidden;
}

.chat-title .mentor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-provider-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.chat-select {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  background: white;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.editor {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: white;
  line-height: 1.5;
}

.editor-inline {
  min-height: 140px;
  margin-top: 8px;
}

.editor table {
  width: 100%;
  border-collapse: collapse;
}

.editor table td,
.editor table th {
  border: 1px solid var(--line);
  padding: 6px;
}

.fullscreen {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.fullscreen.hidden {
  display: none;
}

.fullscreen-content {
  background: #fff;
  border-radius: 18px;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
}

#slides-fullscreen {
  padding: 0;
}

#slides-fullscreen .fullscreen-content {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

#slides-fullscreen .slides-controls {
  margin-bottom: 0;
}

#slides-fullscreen .slides-body {
  flex: 1;
  min-height: 0;
  margin-top: 12px;
}

#slides-fullscreen .slides-body .slide {
  height: 100%;
  min-height: 100%;
}

.fullscreen-body {
  margin-top: 12px;
  padding: 20px;
  border-radius: 16px;
}

.fullscreen-body img {
  display: block;
  width: auto !important;
  max-width: 100%;
  max-height: 78dvh;
  height: auto !important;
  object-fit: contain;
  margin: 12px auto;
}

.fullscreen .video-embed {
  padding-top: 0;
  height: 70vh;
}

.plan-clase-fullscreen {
  display: grid;
  gap: 18px;
}

.plan-clase-fullscreen .actividad-block {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.plan-clase-fullscreen .actividad-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.plan-clase-fullscreen .subactivity-block {
  border-top: 1px dashed var(--line);
  margin-top: 12px;
  padding-top: 12px;
  display: grid;
  gap: 8px;
}

.plantilla-clasica {
  background: #fffdf7;
  border: 1px solid var(--line);
}

.plantilla-afiche {
  background: linear-gradient(120deg, #f4e8d7, #f7f7ff);
  font-size: 20px;
}

.plantilla-pizarra {
  background: #1e293b;
  color: #f8fafc;
  font-family: "Comic Sans MS", "Trebuchet MS", sans-serif;
}

.plantilla-tarjetas {
  background: #f0f7f4;
  padding: 0;
}

.plantilla-tarjetas > * {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  box-shadow: var(--shadow);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(31, 42, 36, 0.35);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: var(--card);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  max-width: 720px;
  width: 100%;
}

#subactivity-modal .modal-card {
  max-width: min(1400px, calc(100vw - 48px));
  max-height: calc(100dvh - 36px);
  overflow: auto;
}

.guardian-share-modal-card {
  max-width: 620px;
}

.student-view-modal-card {
  max-width: 760px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-body {
  display: grid;
  gap: 12px;
}

.guardian-share-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.guardian-share-qr-wrap {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.guardian-share-qr-wrap img {
  width: 260px;
  height: 260px;
  object-fit: contain;
}

.guardian-share-actions {
  justify-content: flex-start;
}

.guardian-share-actions > * {
  flex: 0 0 auto;
}

.student-view-hero {
  display: flex;
  gap: 16px;
  align-items: center;
}

.student-view-avatar {
  width: 84px;
  height: 84px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(215, 208, 196, 0.9);
  background: #fff;
}

.student-view-copy {
  display: grid;
  gap: 8px;
}

.student-view-copy strong {
  font-size: 22px;
}

.student-view-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.student-view-actions {
  margin-top: 4px;
  flex-wrap: wrap;
}

.student-view-actions > * {
  flex: 0 0 auto;
}

.student-view-grid .card {
  padding: 14px;
}

.student-name-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.student-name-button:hover {
  color: var(--accent);
}

.modal-results {
  max-height: 220px;
  overflow: auto;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.6);
}

.library-results {
  max-height: 52vh;
}

.library-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.85);
}

.library-item + .library-item {
  margin-top: 10px;
}

.library-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.loader {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.loader-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(31, 42, 36, 0.08);
  overflow: hidden;
}

.loader-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s ease;
}

.badge {
  background: rgba(42, 127, 98, 0.12);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.badge.danger {
  background: rgba(155, 44, 44, 0.12);
  color: #9b2c2c;
}

.badge.attendance-present {
  background: rgba(42, 127, 98, 0.14);
  color: #1f7a55;
}

.badge.attendance-late {
  background: rgba(216, 137, 59, 0.18);
  color: #a65a12;
}

.badge.attendance-absent {
  background: rgba(180, 68, 68, 0.16);
  color: #a12f2f;
}

.badge.attendance-excused {
  background: rgba(67, 97, 173, 0.16);
  color: #3552a5;
}

.badge.attendance-unknown {
  background: rgba(31, 42, 36, 0.08);
  color: #5a6b63;
}

.badge-muted {
  background: rgba(31, 42, 36, 0.08);
  color: #5a6b63;
}

.button {
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button.disabled,
.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  border: 1px solid var(--line);
}

.button.ghost.danger {
  color: #9b2c2c;
  border-color: rgba(155, 44, 44, 0.4);
}

.button.secondary {
  background: var(--accent-2);
}

.button:active {
  transform: translateY(1px);
}

form {
  display: grid;
  gap: 12px;
}

label {
  font-weight: 600;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.checkbox input {
  width: auto;
}

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: white;
  font-family: inherit;
}

.input-inline {
  width: auto;
  min-width: 220px;
  display: inline-block;
  margin-right: 10px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.notice {
  background: rgba(216, 137, 59, 0.12);
  border-left: 4px solid var(--accent-2);
  padding: 10px 12px;
  border-radius: 12px;
}

.footer {
  margin-top: 24px;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 720px) {
  header {
    padding: 22px 18px 10px;
  }

  main {
    padding: 0 18px 40px;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .preview {
    position: static;
  }

  .chat-widget {
    width: calc(100% - 36px);
    right: 18px;
    left: 18px;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card, .list li {
  animation: fadeUp 0.4s ease both;
}
.lluvia-fields {
  grid-column: 1 / -1;
}

.participacion-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.participacion-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

.participacion-filters .grow {
  flex: 1;
}

.participacion-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 2fr);
  gap: 22px;
  margin-top: 18px;
}

.participacion-list-panel,
.participacion-detail-panel {
  min-height: 420px;
}

.participacion-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 70vh;
  overflow: auto;
  padding-right: 4px;
}

.participacion-student {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: #fffdf8;
  text-align: left;
  cursor: pointer;
}

.participacion-student.active {
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(90, 76, 56, 0.15);
}

.participacion-student h3 {
  margin: 0;
  font-size: 1rem;
}

.participacion-student small {
  color: var(--muted);
}

.participacion-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.participacion-metrics .badge {
  font-size: 0.75rem;
}

.participacion-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.participacion-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.participacion-summary .card {
  background: #fffdf8;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px 14px;
}

.participacion-section h4 {
  margin-bottom: 10px;
}

.participacion-activity {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #fffdf8;
}

.participacion-activity span {
  color: var(--muted);
}

.participacion-ideas {
  display: grid;
  gap: 10px;
}

.participacion-idea {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #fffdf8;
}

.participacion-idea small {
  color: var(--muted);
}

@media (max-width: 900px) {
  .participacion-grid {
    grid-template-columns: 1fr;
  }
  .participacion-list {
    max-height: 40vh;
  }
}

.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.participacion-header h3 {
  margin-bottom: 4px;
}

.participacion-header p {
  margin: 0;
  color: var(--muted);
}

.participacion-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
  margin-bottom: 10px;
}

.toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  display: grid;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: #1f4f42;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  font-weight: 600;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.hide {
  opacity: 0;
  transform: translateY(-6px);
}

.toast-error {
  background: #b84a3a;
}

@media (max-width: 900px) {
  .brand-logo {
    width: 46px;
    height: 46px;
  }
}

body[data-page="horarios"] {
  font-family: "Bree Serif", "Georgia", serif;
}

.horario-header .horario-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.horario-header-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 16px;
  align-items: end;
}

.horario-header-left label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

.horario-header-right {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.horario-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(420px, 2fr);
  gap: 20px;
  margin-top: 16px;
}

.horario-tabs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.horario-tabs .tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.horario-tabs .tab.active {
  background: var(--horario-accent);
  color: #fff;
  border-color: transparent;
}

.horario-view {
  margin-top: 16px;
}

.horario-view-picker label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.horario-view-picker {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.horario-view-picker .button {
  height: 40px;
}

.horario-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.horario-view.hidden,
.horario-grid.hidden {
  display: none;
}

.horario-rows {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.horario-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.horario-row input {
  width: 100%;
}

.horario-table {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.horario-table .horario-row-labels {
  display: grid;
  grid-template-columns: 140px repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.horario-table .horario-header-cell {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  font-weight: 600;
}

.horario-table .horario-grid-body {
  display: grid;
  grid-template-columns: 140px repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.horario-time {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px;
  font-weight: 600;
}

.horario-cell {
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 10px;
  background: rgba(255, 255, 255, 0.85);
  display: grid;
  gap: 8px;
}

.horario-cell.view {
  gap: 6px;
}

.horario-cell .horario-course {
  font-weight: 600;
}

.horario-cell .horario-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
}

.horario-open-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--horario-accent);
  text-decoration: none;
  font-weight: 600;
}

.horario-cell input,
.horario-cell select {
  width: 100%;
}

.horario-cell .button {
  width: 100%;
}

body[data-page="horarios"][data-theme="chalk"] {
  --horario-accent: #1c7c54;
  --horario-surface: #f4f1e7;
  --horario-grid: #1f4f42;
  --horario-cell: #f8e27a;
  background: radial-gradient(circle at top left, #f2efe6 0%, #e1ebe7 45%, #f8f3ea 100%);
}

body[data-page="horarios"][data-theme="leaf"] {
  --horario-accent: #a45b36;
  --horario-surface: #fff4e9;
  --horario-grid: #c9826b;
  --horario-cell: #fff7ef;
  background: radial-gradient(circle at top left, #f8efe4 0%, #f4e2d8 40%, #f1ede3 100%);
}

body[data-page="horarios"][data-theme="pop"] {
  --horario-accent: #e23b3b;
  --horario-surface: #e8f3ff;
  --horario-grid: #5fa2ff;
  --horario-cell: #ffffff;
  background: radial-gradient(circle at top left, #f4f7ff 0%, #e3f4ff 50%, #fff1f8 100%);
}

body[data-page="horarios"] .card {
  border: 2px solid rgba(31, 69, 54, 0.08);
}

body[data-page="horarios"] .button {
  background: var(--horario-accent);
}

body[data-page="horarios"] .horario-table {
  background: var(--horario-surface);
  padding: 16px;
  border-radius: 18px;
  border: 2px solid rgba(0, 0, 0, 0.04);
}

body[data-page="horarios"] .horario-header-cell {
  background: var(--horario-grid);
  color: #fff;
  border-color: transparent;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body[data-page="horarios"] .horario-time {
  background: #ffffff;
  border-color: transparent;
}

body[data-page="horarios"] .horario-cell.view {
  background: var(--horario-cell);
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

body[data-page="horarios"] .horario-open-link {
  color: var(--horario-grid);
}

@media (max-width: 1000px) {
  .horario-grid {
    grid-template-columns: 1fr;
  }
  .horario-table .horario-row-labels,
  .horario-table .horario-grid-body {
    grid-template-columns: 110px repeat(5, minmax(100px, 1fr));
  }
}

.session-toolbar {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.login-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(181, 213, 255, 0.85), transparent 35%),
    linear-gradient(135deg, #eef4ff 0%, #f8f4ea 48%, #edf6ef 100%);
}

.login-shell {
  width: min(100%, 460px);
  padding: 24px;
}

.login-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(50, 70, 100, 0.12);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(45, 64, 89, 0.14);
  backdrop-filter: blur(10px);
}

.login-brand {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.login-brand .brand-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form.hidden {
  display: none;
}

.login-form + .login-form {
  margin-top: 12px;
}

.login-form .button {
  margin-top: 8px;
}
