*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: #f0f4f8;
  color: #1a1a1a;
  min-height: 100vh;
}

/* ── Header ── */
.header { background: #1a56a0; padding: 0.9rem 1.5rem; }

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-left a  { text-decoration: none; }
.header-left h1 { font-size: 1.2rem; font-weight: 700; color: #fff; letter-spacing: -0.02em; }
.header-left p  { font-size: 0.78rem; color: rgba(255,255,255,0.6); margin-top: 0.1rem; }
.header-right   { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.btn-auth {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.85rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.13s;
  white-space: nowrap;
}
.btn-ghost       { background: rgba(255,255,255,0.12); color: #fff; border: 1.5px solid rgba(255,255,255,0.25); }
.btn-ghost:hover { background: rgba(255,255,255,0.22); }
.btn-solid       { background: #fff; color: #1a56a0; border: 1.5px solid #fff; }
.btn-solid:hover { background: #e8f0fb; }
.btn-logout      { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.85); border: 1.5px solid rgba(255,255,255,0.18); }
.btn-logout:hover { background: rgba(255,255,255,0.18); }

.auth-label   { font-size: 0.76rem; color: rgba(255,255,255,0.6); }
.auth-divider { width: 1px; height: 18px; background: rgba(255,255,255,0.2); }

/* ── Contenedor general ── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ── Tablero: título ── */
.titulo-busqueda {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
  color: #1a1a1a;
}

/* ── Tablero: breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #bbb;
  margin-bottom: 1.8rem;
}
.breadcrumb a       { color: #1a56a0; text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep    { color: #ddd; }

/* ── Tablero: deptos ── */
.deptos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (max-width: 700px) {
  .deptos { grid-template-columns: repeat(2, 1fr); }
}

.depto-carta {
  display: block;
  text-decoration: none;
  background: #fff;
  border: 2px solid #dce8f5;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.15s;
  cursor: pointer;
}
.depto-carta:hover {
  border-color: #1a56a0;
  box-shadow: 0 8px 24px rgba(26,86,160,.12);
  transform: translateY(-2px);
}
.depto-carta.activa               { border-color: #1a56a0; background: #1a56a0; }
.depto-carta.activa .depto-nombre { color: #fff; }
.depto-carta.activa .depto-sub    { color: rgba(255,255,255,0.7); }

.depto-icono  { width: 2rem; height: 2rem; margin: 0 auto 0.75rem; color: #1a56a0; display: flex; align-items: center; justify-content: center; }
.depto-icono svg { width: 100%; height: 100%; }
.depto-carta.activa .depto-icono { color: #fff; }
.depto-nombre { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; color: #1a1a1a; }
.depto-sub    { font-size: 0.78rem; color: #aaa; margin-top: 0.25rem; }

/* ── Tablero: ramos ── */
.ramos-seccion { margin-bottom: 2rem; animation: fadeDown 0.25s ease both; }

.ramos-titulo {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #aaa;
  margin-bottom: 0.8rem;
}

.ramos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
}

.ramo-btn {
  display: block;
  text-decoration: none;
  background: #fff;
  border: 1.5px solid #dce8f5;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  transition: all 0.12s;
}
.ramo-btn:hover  { border-color: #1a56a0; color: #1a56a0; }
.ramo-btn.activo { background: #eef4fd; border-color: #1a56a0; color: #1a56a0; font-weight: 600; }

/* ── Tablero: profesores ── */
.profesores-seccion { animation: fadeDown 0.25s ease both; }

.profesores-titulo {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #aaa;
  margin-bottom: 0.8rem;
}

.profesores-lista { background: #fff; border-radius: 14px; border: 1px solid #dce8f5; overflow: hidden; }

.profesor-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid #eef4fd;
  transition: background 0.12s;
  color: #1a1a1a;
  text-decoration: none;
}
.profesor-item:last-child { border-bottom: none; }
.profesor-item:hover      { background: #f5f9ff; }

.profesor-foto { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid #dce8f5; }

.profesor-foto-placeholder {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: #1a56a0;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.profesor-info   { flex: 1; min-width: 0; }
.profesor-nombre { font-weight: 600; font-size: 0.92rem; color: #1a1a1a; }
.profesor-ramos  { font-size: 0.75rem; color: #999; margin-top: 0.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.profesor-precio      { font-weight: 700; font-size: 0.95rem; color: #1a56a0; white-space: nowrap; flex-shrink: 0; }
.profesor-precio span { font-size: 0.72rem; font-weight: 500; color: #bbb; margin-left: 2px; }

.vacio { padding: 2.5rem; text-align: center; color: #bbb; font-size: 0.88rem; }

/* ── Login / Registro ── */
body.login-page { display: flex; flex-direction: column; }

.page-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}

.login-card {
  background: #fff;
  border: 1.5px solid #dce8f5;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
}

.card-icon {
  width: 48px; height: 48px;
  background: #1a56a0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
}
.card-icon svg { width: 22px; height: 22px; }

.login-card h2         { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.04em; color: #1a1a1a; margin-bottom: 0.3rem; }
.login-card .subtitulo { font-size: 0.82rem; color: #aaa; margin-bottom: 1.8rem; }

.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #555;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.field input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid #dce8f5;
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: inherit;
  color: #1a1a1a;
  background: #f5f9ff;
  outline: none;
  transition: border-color 0.12s;
}
.field input:focus { border-color: #1a56a0; background: #fff; }

.error-msg {
  background: #fff0f0;
  border: 1.5px solid #e53e3e;
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  font-size: 0.82rem;
  color: #c53030;
  margin-bottom: 1.2rem;
}

.btn-submit {
  width: 100%;
  padding: 0.75rem;
  background: #1a56a0;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 0.5rem;
  letter-spacing: -0.01em;
  transition: background 0.12s;
}
.btn-submit:hover { background: #154480; }

.footer-link   { text-align: center; margin-top: 1.2rem; font-size: 0.8rem; color: #aaa; }
.footer-link a { color: #1a56a0; font-weight: 600; text-decoration: none; }

/* ── Animación ── */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Avatar header ── */
.avatar-link { display: inline-flex; text-decoration: none; flex-shrink: 0; }

.avatar-img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.5);
  transition: border-color 0.13s, transform 0.13s;
}
.avatar-img:hover { border-color: #fff; transform: scale(1.07); }

.avatar-placeholder {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.5);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.13s, border-color 0.13s, transform 0.13s;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.avatar-placeholder:hover { background: rgba(255,255,255,0.3); border-color: #fff; transform: scale(1.07); }

/* ── Layout perfil ── */
body.perfil-page { display: block; }

.perfil-layout {
  display: grid;
  grid-template-columns: 300px 2fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 780px) {
  .perfil-layout { grid-template-columns: 1fr; }
}

.perfil-izq { display: flex; flex-direction: column; gap: 1rem; }

.perfil-card {
  background: #fff;
  border: 1.5px solid #dce8f5;
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.perfil-foto {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #dce8f5;
  flex-shrink: 0;
}

.perfil-foto-placeholder {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: #1a56a0;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.perfil-info     { flex: 1; min-width: 0; }
.perfil-nombre   { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.03em; color: #1a1a1a; margin-bottom: 0.1rem; }
.perfil-username { font-size: 0.78rem; color: #aaa; margin-bottom: 0.4rem; }

.perfil-badge {
  display: inline-block;
  background: #eef4fd;
  color: #1a56a0;
  border: 1.5px solid #b3cff0;
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.perfil-datos {
  background: #fff;
  border: 1.5px solid #dce8f5;
  border-radius: 14px;
  overflow: hidden;
}

.perfil-seccion-titulo {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #aaa;
  padding: 0.8rem 1.1rem 0.4rem;
}

.perfil-fila {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid #eef4fd;
  gap: 1rem;
}
.perfil-fila:last-child { border-bottom: none; }

.perfil-label  { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #aaa; flex-shrink: 0; }
.perfil-valor  { font-size: 0.85rem; font-weight: 500; color: #1a1a1a; text-align: right; }
.perfil-precio { color: #1a56a0; font-weight: 700; }
.perfil-precio span { font-size: 0.72rem; color: #bbb; font-weight: 400; margin-left: 2px; }

.perfil-ramos-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.7rem 1.1rem 1rem;
}

.perfil-ramo-tag {
  background: #f0f4f8;
  border: 1.5px solid #dce8f5;
  border-radius: 8px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #555;
}

.perfil-acciones { margin-top: 0.5rem; }

.avatar-img-grande {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #dce8f5;
  margin: 0 auto 1.1rem;
  display: block;
}

/* ── Horario contenedor ── */
.perfil-der {
  background: #fff;
  border: 1.5px solid #dce8f5;
  border-radius: 16px;
  padding: 1.5rem;
}

.horario-header { margin-bottom: 1.2rem; }
.horario-titulo { font-size: 1rem; font-weight: 800; letter-spacing: -0.02em; color: #1a1a1a; margin-bottom: 0.2rem; }
.horario-sub    { font-size: 0.78rem; color: #aaa; }

.horario-grid {
  display: grid;
  grid-template-columns: 50px repeat(6, 1fr);
  gap: 2px;
}

.horario-dia {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #aaa;
  padding: 0.2rem 0;
}

.horario-dia-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  user-select: none;
}

.horario-dia-label input[type="checkbox"] {
  width: 13px; height: 13px;
  accent-color: #1a56a0;
  cursor: pointer;
}

.horario-hora {
  font-size: 0.65rem;
  color: #bbb;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  white-space: nowrap;
}

/* ── Bloques horario — colores manejados 100% por JS inline ── */
.horario-bloque {
  height: 28px;
  border-radius: 4px;
  border: 1.5px solid #dce8f5;
  background: #f0f4f8;
  cursor: pointer;
}

.horario-bloque.bloqueado {
  cursor: default;
  pointer-events: none;
}

.horario-bloque.solo-lectura {
  cursor: default;
  /* ELIMINA pointer-events: none de aquí */
}

.horario-bloque.solo-lectura.bloqueado-permanente {
  cursor: default;
  pointer-events: none;
}

body.modo-agendar .horario-bloque.disponible-click {
  cursor: pointer !important;
  pointer-events: all !important;
}

/* ── Horario modos ── */
.horario-acciones {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.btn-horario {
  padding: 0.4rem 1rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
  border: 1.5px solid transparent;
}

.btn-horario-editar          { background: #fff; color: #1a56a0; border-color: #1a56a0; }
.btn-horario-editar:hover    { background: #eef4fd; }
.btn-horario-guardar         { background: #1a56a0; color: #fff; border-color: #1a56a0; }
.btn-horario-guardar:hover   { background: #154480; }
.btn-horario-descartar       { background: #fff; color: #888; border-color: #dce8f5; }
.btn-horario-descartar:hover { background: #f0f4f8; }

/* ── Ramo checkboxes ── */
.ramo-check-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f0f4f8;
  border: 1.5px solid #dce8f5;
  border-radius: 8px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: all 0.12s;
}
.ramo-check-label:hover             { border-color: #1a56a0; color: #1a56a0; }
.ramo-check-label.ramo-check-activo { background: #eef4fd; border-color: #1a56a0; color: #1a56a0; }
.ramo-check-label input[type="checkbox"] { display: none; }

.campo-oculto { display: none; }

.badge-pendiente  { background:#f5f5f0; color:#aaa; border:1.5px solid #e8e8e3; }
.badge-confirmada { background:#eef4fd; color:#1a56a0; border:1.5px solid #b3cff0; }
.badge-cancelada  { background:#fff5f5; color:#e74c3c; border:1.5px solid #f5c6c6; }
.badge-reserva    { font-size:0.72rem; font-weight:700; padding:0.2rem 0.6rem; border-radius:20px; }

.horario-bloque.disponible-click {
  cursor: pointer;
}
.horario-bloque.disponible-click:hover {
  transform: scale(1.15);
  z-index: 1;
}

.badge-pendiente { background:#fef9e7; color:#f39c12; border:1.5px solid #f9d77e; }

.notif-icono { width:36px; height:36px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:1rem; }
.notif-icono-creada     { background:#fef9e7; }
.notif-icono-confirmada { background:#eef4fd; }
.notif-icono-cancelada  { background:#fff5f5; }

.btn-hamburguesa {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  padding: 7px 8px;
  cursor: pointer;
  margin-right: 0.5rem;
}
.btn-hamburguesa span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.2s;
}