/* Home del alumno (student.html) y sus modales de vincular clase/libro.
   También cubre la barra superior compartida .sh-topbar (alumno + apoderado,
   ver index.html:isEstudianteArea/isApoderadoArea). Todo queda scopeado a
   clases con prefijo .sh- para no afectar otras páginas. Las clases
   card-class-help / card-class / btn-add-class se dejaron intactas porque
   student.js las usa directo por nombre (getElementsByClassName) para el
   tutorial de primeros pasos. */

.sh-topbar {
  background: linear-gradient(120deg, var(--ebiocolornav), #1565c0);
  padding: .7rem 1.5rem;
  margin: 0;
  display: flex;
  align-items: center;
}

.sh-topbar .ebiologo {
  height: 30px;
}

.sh-topbar-avatar {
  border-radius: 50%;
}

.sh-topbar .dropdown-menu {
  position: absolute !important;
}

.sh-page {
  background-color: #f4f6f9;
  /* min-height:100% necesita que TODOS los contenedores padres tengan una
     altura definida para funcionar; si la página queda más corta que la
     pantalla, se veía el blanco de abajo asomando. 100vh depende
     directamente del viewport, no de los padres. */
  min-height: 100vh;
  padding-bottom: 1rem;
}

.sh-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 1rem;
}

/* Saludo */

.sh-greeting {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.sh-greeting-avatar {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #e8f1fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.sh-greeting-text {
  flex: 1 1 260px;
}

.sh-greeting-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2c313a;
  margin: 0 0 .2rem;
}

.sh-greeting-sub {
  color: #7a8296;
  font-size: .9rem;
  margin: 0;
}

.sh-greeting-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.sh-attorney-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border: none;
  border-radius: .6rem;
  padding: .65rem 1.2rem;
  font-weight: 700;
  font-size: .8rem;
  color: #fff;
}

.sh-attorney-ok {
  background-color: #2ecc71;
}

.sh-attorney-missing {
  background-color: #e6553f;
}

/* Tarjetas */

.sh-card {
  background-color: #fff;
  border-radius: 1rem;
  box-shadow: 0 2px 10px rgba(20, 30, 60, .06);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.sh-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}

.sh-card-header-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  color: #2c313a;
  font-size: 1rem;
}

.sh-card-header-title i {
  color: var(--ebiocolornav);
}

.sh-card-footer {
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid #eef0f2;
}

.sh-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
  color: var(--ebiocolornav);
  font-size: 1.6rem;
}

.sh-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 2rem 0;
  color: #9aa1b1;
  text-align: center;
}

.sh-empty-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #e6f7ef;
  color: #2ecc71;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: .5rem;
}

.sh-empty-title {
  font-weight: 700;
  color: #2c313a;
  font-size: .95rem;
}

.sh-empty-sub {
  color: #9aa1b1;
  font-size: .8rem;
  max-width: 220px;
}

/* Mis clases */

.sh-class-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid #eef0f2;
}

.sh-class-row:last-child {
  border-bottom: none;
}

.sh-class-cover {
  flex-shrink: 0;
  width: 46px;
  height: 60px;
  object-fit: cover;
  border-radius: .4rem;
}

.sh-class-info {
  flex: 1 1 auto;
  min-width: 0;
}

.sh-class-name {
  font-weight: 700;
  color: #2c313a;
  font-size: .95rem;
}

.sh-class-book {
  color: #7a8296;
  font-size: .82rem;
  margin-top: .1rem;
}

.sh-class-meta {
  color: #9aa1b1;
  font-size: .78rem;
  margin-top: .3rem;
}

.sh-class-enter-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Libros vinculados */

.sh-books-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .5rem 1.5rem;
}

.sh-book-row {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .75rem 0;
  border-bottom: 1px solid #eef0f2;
}

.sh-books-grid .sh-book-row:nth-last-child(-n+2) {
  border-bottom: none;
}

.sh-book-cover {
  flex-shrink: 0;
  width: 42px;
  height: 56px;
  object-fit: cover;
  border-radius: .35rem;
}

.sh-book-info {
  flex: 1 1 auto;
  min-width: 0;
}

.sh-book-name {
  font-weight: 700;
  color: #2c313a;
  font-size: .88rem;
}

.sh-book-code {
  color: #7a8296;
  font-size: .78rem;
  margin-top: .1rem;
}

.sh-book-meta {
  color: #9aa1b1;
  font-size: .76rem;
  margin-top: .2rem;
}

.sh-book-open-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: .6rem;
  border: 1px solid var(--ebiocolornav);
  color: var(--ebiocolornav);
  background-color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sh-book-open-btn:hover {
  background-color: var(--ebiocolornav);
  color: #fff;
}

@media (max-width: 767px) {
  .sh-books-grid {
    grid-template-columns: 1fr;
  }

  .sh-books-grid .sh-book-row:nth-last-child(-n+2) {
    border-bottom: 1px solid #eef0f2;
  }

  .sh-books-grid .sh-book-row:last-child {
    border-bottom: none;
  }
}

/* Tarjeta de ayuda / tutorial */

.sh-help-card {
  background: linear-gradient(120deg, #fff, #f2f7fc);
}

.sh-help-text {
  font-size: .95rem;
  color: #2c313a;
}

.sh-help-step {
  font-weight: 700;
  color: #52596b;
  margin-bottom: .4rem;
}

/* Notificaciones */

.sh-notif-item {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .75rem 0;
  border-bottom: 1px solid #eef0f2;
}

.sh-notif-item:last-child {
  border-bottom: none;
}

.sh-notif-item>i {
  color: var(--ebiocolornav);
  margin-top: .2rem;
}

.sh-notif-body {
  flex: 1 1 auto;
  min-width: 0;
  font-size: .85rem;
  color: #2c313a;
}

.sh-notif-date {
  color: #9aa1b1;
  font-size: .76rem;
  margin-top: .25rem;
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}

.sh-notif-detail {
  color: #2ecc71;
  font-weight: 600;
  cursor: pointer;
}

/* Botones compartidos */

.sh-btn-success,
.sh-btn-info,
.sh-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: .6rem;
  padding: .6rem 1.1rem;
  font-weight: 600;
  font-size: .82rem;
  border: 1px solid transparent;
}

.sh-btn-success {
  background-color: #2ecc71;
  color: #fff;
}

.sh-btn-success:hover {
  opacity: .92;
  color: #fff;
  text-decoration: none;
}

.sh-btn-info {
  background-color: var(--ebiocolornav);
  color: #fff;
}

.sh-btn-info:hover {
  opacity: .92;
  color: #fff;
  text-decoration: none;
}

.sh-btn-outline {
  background-color: #fff;
  border-color: var(--ebiocolornav);
  color: var(--ebiocolornav);
}

.sh-btn-outline:hover {
  background-color: var(--ebiocolornav);
  color: #fff;
  text-decoration: none;
}

/* Pie de página */

.sh-footer {
  text-align: center;
  color: #9aa1b1;
  font-size: .8rem;
  padding: 1.5rem 0 .5rem;
}

/* Modales de vincular clase / libro */

.sh-modal-content {
  border: none;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(20, 30, 60, .18);
}

.sh-modal-header {
  background-color: var(--ebiocolornav);
  color: #fff;
  border: none;
  align-items: center;
  padding: 1.1rem 1.25rem 1.1rem 1.75rem !important;
}

.sh-modal-header .modal-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.sh-modal-close {
  flex-shrink: 0;
  margin-left: 1rem;
  border: none;
  background-color: rgba(255, 255, 255, .18);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sh-modal-close:hover {
  background-color: rgba(255, 255, 255, .32);
}

.sh-modal-body {
  padding: 1.5rem;
}

.sh-modal-lead {
  color: #52596b;
  font-size: .88rem;
  margin-bottom: 1rem;
}

.sh-input-group {
  position: relative;
  margin-bottom: 1rem;
}

.sh-input-group>i {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  color: #9aa1b1;
}

.sh-input {
  width: 100%;
  border: 1px solid #e2e6ec;
  border-radius: .6rem;
  padding: .65rem .9rem .65rem 2.5rem;
  font-size: .9rem;
  color: #2c313a;
  background-color: #f9fafc;
}

.sh-input:focus {
  outline: none;
  border-color: var(--ebiocolornav);
  background-color: #fff;
}

.sh-modal-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  padding: 1.5rem 0;
  color: var(--ebiocolornav);
  font-size: .9rem;
  text-align: center;
}

.sh-modal-state i {
  font-size: 1.5rem;
}

.sh-modal-state-muted {
  color: #9aa1b1;
}

.sh-modal-state-success {
  color: #2ecc71;
}

.sh-modal-state-danger {
  color: #e6553f;
}

.sh-modal-found {
  background-color: #f9fafc;
  border-radius: .9rem;
  padding: 1rem;
}

.sh-modal-found-label {
  font-weight: 700;
  color: #2c313a;
  margin-bottom: .75rem;
}

.sh-modal-found-book {
  display: flex;
  align-items: center;
  gap: .9rem;
  background-color: #fff;
  border-radius: .7rem;
  padding: .75rem;
  margin-bottom: .6rem;
}

.sh-modal-found-book:last-child {
  margin-bottom: 0;
}

.sh-modal-found-cover {
  flex-shrink: 0;
  width: 40px;
  height: 52px;
  object-fit: cover;
  border-radius: .35rem;
}

.sh-modal-found-name {
  font-weight: 700;
  color: #2c313a;
  font-size: .88rem;
  margin: 0;
}

.sh-modal-found-sub {
  color: #7a8296;
  font-size: .8rem;
  margin: 0;
}

.sh-modal-found-class {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.sh-modal-found-avatar {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.sh-modal-footer {
  border-top: 1px solid #eef0f2;
  padding: 1rem 1.5rem;
}

@media (max-width: 767px) {
  .sh-greeting {
    flex-direction: column;
    align-items: flex-start;
  }

  .sh-greeting-actions {
    width: 100%;
  }

  .sh-greeting-actions>* {
    flex: 1 1 auto;
  }
}
