* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111;
  color: #eee;
  display: grid;
  grid-template-columns: 360px 1fr;
  height: 100vh;
}

#sidebar {
  border-right: 1px solid #333;
  padding: 18px;
  overflow-y: auto;
  background: #181818;
}

#sidebar h1 {
  margin: 0 0 16px;
  font-size: 1.4rem;
}

#buscador {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #0e0e0e;
  color: #eee;
}

#contenido {
  padding: 28px;
  overflow-y: auto;
}

summary {
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 6px;
  font-size: 0.95rem;
}

summary:hover {
  background: #252525;
}

details {
  margin-left: 12px;
}

.archivo-nav,
.resultado-busqueda {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #ddd;
  padding: 5px 8px 5px 22px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.88rem;
}

.archivo-nav:hover,
.resultado-busqueda:hover {
  background: #252525;
}

video {
  width: 100%;
  max-height: 78vh;
  background: #000;
  border-radius: 12px;
}

.pdf {
  width: 100%;
  height: 78vh;
  border: 0;
  background: #222;
  border-radius: 12px;
}

audio {
  width: 100%;
  margin-top: 20px;
}

.imagen {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
}

.visor-header {
  margin-bottom: 20px;
}

.visor-header h2 {
  margin: 0 0 6px;
}

.ruta {
  color: #aaa;
  margin: 0;
  font-size: 0.9rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.card,
.material-item {
  border: 1px solid #333;
  background: #1d1d1d;
  color: #eee;
  border-radius: 10px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.card:hover,
.material-item:hover {
  background: #292929;
}

.lista-materiales {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

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

.icono {
  width: 24px;
  opacity: 0.8;
}

.boton {
  display: inline-block;
  margin-top: 16px;
  color: #fff;
  background: #333;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
}

.boton:hover {
  background: #444;
}

.inicio {
  color: #ccc;
}

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
    height: auto;
  }

  #sidebar {
    height: 45vh;
    border-right: 0;
    border-bottom: 1px solid #333;
  }

  #contenido {
    min-height: 55vh;
  }
}
