/* Agenda Corporativa Web — mismo lenguaje visual que consultores360.pe
   (azul #1670ea, texto oscuro #17233f) pero diseño propio para una app de
   uso diario, no una landing (Punto 15 del GOAL: no copiar Flutter pixel
   a pixel, tampoco copiar la landing — construir lo que esta app necesita). */

* { box-sizing: border-box; }
body {
  margin: 0;
  background: #f4f6fa;
  font-family: Arial, Helvetica, sans-serif;
  color: #17233f;
}
a { color: inherit; }
button {
  font-family: inherit;
  cursor: pointer;
}

/* --- Login --- */
.login-pantalla {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-caja {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 12px 30px #00000018;
}
.login-caja h1 {
  font-size: 26px;
  margin: 0 0 4px;
}
.login-caja h1 span { color: #1670ea; }
.login-caja .sub {
  color: #526076;
  margin-bottom: 24px;
  font-size: 15px;
}
.campo {
  margin-bottom: 14px;
}
.campo label {
  display: block;
  font-size: 13px;
  color: #526076;
  margin-bottom: 4px;
}
.campo input, .campo select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d6dce6;
  border-radius: 8px;
  font-size: 15px;
}
.boton-primario {
  width: 100%;
  background: #1670ea;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
}
.boton-primario:disabled { opacity: .6; cursor: default; }
.boton-secundario {
  background: #fff;
  border: 1px solid #d6dce6;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  color: #17233f;
}
.boton-peligro {
  background: #e0453c;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
}
.mensaje-error {
  color: #e0453c;
  font-size: 14px;
  margin-top: 10px;
}
.mensaje-info {
  color: #526076;
  font-size: 14px;
  margin-top: 10px;
}

/* --- Shell principal --- */
.shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  grid-template-rows: 56px 1fr;
  height: 100vh;
}
.shell-header {
  grid-column: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: #17233f;
  color: #fff;
}
.shell-header .marca { font-weight: 800; letter-spacing: -0.5px; }
.shell-header .marca span { color: #5b9bff; }
.shell-header .usuario { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.shell-sidebar {
  background: #fff;
  border-right: 1px solid #e3e8f0;
  padding: 16px 0;
  overflow-y: auto;
}
.shell-sidebar nav a {
  display: block;
  padding: 12px 20px;
  text-decoration: none;
  color: #17233f;
  font-size: 15px;
  border-left: 3px solid transparent;
}
.shell-sidebar nav a.activo {
  border-left-color: #1670ea;
  background: #eef4ff;
  color: #1670ea;
  font-weight: 700;
}
.shell-sidebar nav .separador {
  margin: 14px 20px 6px;
  font-size: 12px;
  color: #8a95a8;
  text-transform: uppercase;
}
.shell-contenido {
  overflow-y: auto;
  padding: 0;
}

/* --- Listas (conversaciones/salones/usuarios) --- */
.panel-lista {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100%;
}
.lista {
  border-right: 1px solid #e3e8f0;
  overflow-y: auto;
  background: #fff;
}
.lista-item {
  display: block;
  padding: 14px 18px;
  border-bottom: 1px solid #eef1f6;
  text-decoration: none;
  color: #17233f;
  cursor: pointer;
}
.lista-item:hover { background: #f7f9fc; }
.lista-item.activo { background: #eef4ff; }
.lista-item .titulo { font-weight: 700; font-size: 15px; }
.lista-item .detalle { font-size: 13px; color: #667085; margin-top: 2px; }
.lista-vacia { padding: 30px; color: #8a95a8; text-align: center; }

/* --- Detalle de conversación/salón --- */
.detalle {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.detalle-header {
  padding: 14px 20px;
  border-bottom: 1px solid #e3e8f0;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.detalle-header h2 { margin: 0; font-size: 17px; }
.mensajes {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.burbuja {
  max-width: 60%;
  padding: 10px 14px;
  border-radius: 12px;
  background: #eef1f6;
  align-self: flex-start;
}
.burbuja.propio {
  background: #1670ea;
  color: #fff;
  align-self: flex-end;
}
.burbuja .autor { font-size: 12px; font-weight: 700; opacity: .75; margin-bottom: 2px; }
.burbuja .hora { font-size: 11px; opacity: .6; margin-top: 4px; }
.burbuja img, .burbuja video { max-width: 100%; border-radius: 8px; display: block; }
.burbuja audio { width: 240px; }
.burbuja .archivo-doc {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff33;
  border-radius: 8px;
  padding: 8px 10px;
}
.enviar-mensaje {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #e3e8f0;
  background: #fff;
}
.enviar-mensaje input[type=text] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #d6dce6;
  border-radius: 20px;
  font-size: 15px;
}

/* --- Administración --- */
.tabla-admin { width: 100%; border-collapse: collapse; background: #fff; }
.tabla-admin th, .tabla-admin td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #eef1f6;
  font-size: 14px;
}
.tabla-admin th { color: #667085; font-weight: 700; font-size: 12px; text-transform: uppercase; }
.estado-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.estado-pill.activo { background: #dff5e8; color: #18ad67; }
.estado-pill.inactivo { background: #fde7e5; color: #e0453c; }
.panel-admin-acciones { display: flex; gap: 6px; flex-wrap: wrap; }
.panel-admin-acciones button { font-size: 12px; padding: 6px 10px; }
.barra-admin {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
}

.contenido-scroll { padding: 20px; max-width: 680px; }

/* --- Modal simple (crear/editar usuario, restablecer password) --- */
.fondo-modal {
  position: fixed;
  inset: 0;
  background: #0d1a3366;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal {
  background: #fff;
  border-radius: 14px;
  padding: 26px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 { margin-top: 0; }
.modal .acciones-modal {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.aviso-password-temporal {
  background: #fff7e0;
  border: 1px solid #f0d98c;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  margin-top: 10px;
  word-break: break-all;
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 56px auto 1fr; }
  .shell-sidebar {
    border-right: none;
    border-bottom: 1px solid #e3e8f0;
    padding: 6px 0;
  }
  .shell-sidebar nav { display: flex; overflow-x: auto; }
  .shell-sidebar nav a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .shell-sidebar nav a.activo { border-left-color: transparent; border-bottom-color: #1670ea; }
  .shell-sidebar nav .separador { display: none; }
  .panel-lista { grid-template-columns: 1fr; }
  .lista { border-right: none; max-height: 40vh; }
  .burbuja { max-width: 85%; }
}
