/* ================================================================
   VIVE I.P.S — admin.css
   Estilos del panel de administrador
   ================================================================ */

/* ── LAYOUT ── */
.admin-page {
  min-height: 100vh;
  background: var(--gris);
  display: flex;
}

/* ── SIDEBAR ── */
.admin-sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--texto);
  position: fixed;
  left: 0; top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-logo {
  padding: 24px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-logo img {
  height: 42px;
  mix-blend-mode: screen;
  opacity: 0.95;
}
.sidebar-logo span {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}
.sidebar-nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 16px 12px 8px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radio-md);
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.sidebar-link:hover {
  background: rgba(255,255,255,0.07);
  color: white;
}
.sidebar-link.active {
  background: var(--gradiente);
  color: white;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(27,170,181,0.3);
}
.sidebar-link .link-icon { font-size: 18px; flex-shrink: 0; }
.sidebar-link .link-badge {
  margin-left: auto;
  background: #e74c3c;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
}
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.sidebar-admin-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radio-md);
}
.sidebar-admin-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gradiente);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.sidebar-admin-info strong { display: block; font-size: 13px; color: white; font-weight: 700; }
.sidebar-admin-info span  { font-size: 11px; color: rgba(255,255,255,0.45); }
.btn-sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  margin-top: 8px;
  border-radius: var(--radio-md);
  border: 1px solid rgba(255,255,255,0.1);
  background: none;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-sidebar-logout:hover { background: rgba(231,76,60,0.15); border-color: #e74c3c; color: #e74c3c; }

/* ── CONTENIDO PRINCIPAL ── */
.admin-main {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  height: 64px;
  background: white;
  border-bottom: 1px solid var(--gris-borde);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--sombra-sm);
}
.admin-topbar-title h2 {
  font-family: 'Nunito', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--texto);
}
.admin-topbar-title span { font-size: 13px; color: var(--texto-suave); }
.admin-topbar-actions { display: flex; align-items: center; gap: 10px; }

.admin-content {
  padding: 32px 36px 60px;
  flex: 1;
}

/* ── VISTAS (tabs de contenido) ── */
.admin-view { display: none; }
.admin-view.active { display: block; }

/* ── TARJETAS DE ESTADÍSTICAS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.stat-card {
  background: white;
  border-radius: var(--radio-xl);
  padding: 24px 26px;
  box-shadow: var(--sombra-sm);
  border: 1px solid rgba(27,90,166,0.05);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--sombra-md); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radio-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.stat-icon.azul    { background: var(--azul-light); }
.stat-icon.verde   { background: #eafaf1; }
.stat-icon.amarillo{ background: #fef9e7; }
.stat-icon.rojo    { background: #fdf2f2; }
.stat-info strong {
  display: block;
  font-family: 'Nunito', sans-serif;
  font-size: 30px;
  font-weight: 900;
  color: var(--texto);
  line-height: 1;
}
.stat-info span { font-size: 13px; color: var(--texto-suave); margin-top: 4px; display: block; }

/* ── ALERTAS ── */
.alertas-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}
.alerta-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: var(--radio-lg);
  border: 1.5px solid;
  background: white;
}
.alerta-item.rojo   { border-color: #fecaca; background: #fef2f2; }
.alerta-item.amarillo { border-color: #fed7aa; background: #fffbeb; }
.alerta-icon { font-size: 22px; flex-shrink: 0; }
.alerta-texto { flex: 1; }
.alerta-texto strong { display: block; font-size: 14px; font-weight: 700; color: var(--texto); }
.alerta-texto span   { font-size: 12px; color: var(--texto-suave); }
.alerta-accion {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.alerta-accion.rojo    { background: #fef2f2; color: #e74c3c; border: 1px solid #fecaca; }
.alerta-accion.rojo:hover { background: #e74c3c; color: white; }
.alerta-accion.amarillo { background: #fffbeb; color: #d97706; border: 1px solid #fed7aa; }
.alerta-accion.amarillo:hover { background: #f59e0b; color: white; }

/* ── TABLA DE PROFESIONALES ── */
.tabla-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.tabla-busqueda {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.input-buscar {
  padding: 9px 16px 9px 38px;
  border: 1.5px solid var(--gris-borde);
  border-radius: var(--radio-md);
  font-size: 14px;
  font-family: 'Outfit', sans-serif;
  outline: none;
  width: 260px;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%234a6070' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.099zm-5.242 1.156a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E") no-repeat 12px center;
  transition: border-color 0.2s;
}
.input-buscar:focus { border-color: var(--teal); }

.select-filtro {
  padding: 9px 14px;
  border: 1.5px solid var(--gris-borde);
  border-radius: var(--radio-md);
  font-size: 14px;
  font-family: 'Outfit', sans-serif;
  outline: none;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
}
.select-filtro:focus { border-color: var(--teal); }

.tabla-wrap {
  background: white;
  border-radius: var(--radio-xl);
  box-shadow: var(--sombra-sm);
  border: 1px solid rgba(27,90,166,0.05);
  overflow: hidden;
}
.tabla-profesionales {
  width: 100%;
  border-collapse: collapse;
}
.tabla-profesionales thead {
  background: var(--gris);
  border-bottom: 1px solid var(--gris-borde);
}
.tabla-profesionales th {
  padding: 13px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--texto-suave);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}
.tabla-profesionales td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--texto);
  border-bottom: 1px solid var(--gris-borde);
  vertical-align: middle;
}
.tabla-profesionales tbody tr:last-child td { border-bottom: none; }
.tabla-profesionales tbody tr:hover { background: #fafcff; }

.prof-info { display: flex; align-items: center; gap: 12px; }
.prof-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gradiente);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.prof-nombre { font-weight: 700; font-size: 14px; }
.prof-cedula { font-size: 12px; color: var(--texto-suave); }

.docs-mini {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.doc-mini-badge {
  width: 10px; height: 10px;
  border-radius: 50%;
  title: '';
}
.doc-mini-badge.vigente    { background: #27ae60; }
.doc-mini-badge.vencer     { background: #f39c12; }
.doc-mini-badge.por-vencer { background: #f39c12; }
.doc-mini-badge.vencido    { background: #e74c3c; }
.doc-mini-badge.sin-cargar { background: #bdc3c7; }
.doc-mini-badge.sin_cargar { background: #bdc3c7; }

.estado-badge {
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
}
.estado-badge.activo    { background: #eafaf1; color: #27ae60; }
.estado-badge.inactivo  { background: #f4f6f7; color: #7f8c8d; }

.tabla-acciones { display: flex; gap: 6px; }
.btn-tabla {
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-ver-prof    { background: var(--azul-light); color: var(--azul); }
.btn-ver-prof:hover { background: var(--azul); color: white; }
.btn-pdf-prof    { background: #fdf2f2; color: #e74c3c; }
.btn-pdf-prof:hover { background: #e74c3c; color: white; }

/* ── MODAL PROFESIONAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: white;
  border-radius: var(--radio-xl);
  width: 100%;
  max-width: 700px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.modal-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--gris-borde);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  font-family: 'Nunito', sans-serif;
  font-size: 20px;
  font-weight: 800;
}
.btn-modal-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--gris);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.btn-modal-close:hover { background: var(--gris-borde); }
.modal-body { padding: 24px 28px; }
.modal-footer {
  padding: 16px 28px 24px;
  border-top: 1px solid var(--gris-borde);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.modal-prof-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--gris);
  border-radius: var(--radio-lg);
}
.modal-prof-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--gradiente);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.modal-prof-nombre { font-family: 'Nunito', sans-serif; font-size: 20px; font-weight: 900; }
.modal-prof-cargo  { font-size: 13px; color: var(--texto-suave); margin-top: 2px; }
.modal-prof-cedula { font-size: 12px; color: var(--texto-suave); }

.modal-docs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.modal-doc-item {
  padding: 14px 16px;
  border-radius: var(--radio-md);
  border: 1.5px solid var(--gris-borde);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.modal-doc-item.vigente  { border-color: #bbf7d0; background: #f0fdf4; }
.modal-doc-item.vencer   { border-color: #fed7aa; background: #fffbeb; }
.modal-doc-item.vencido    { border-color: #fecaca; background: #fef2f2; }
.modal-doc-item.sin-cargar { border-color: var(--gris-borde); background: var(--gris); }
.modal-doc-item.por-vencer { border-color: #fed7aa; background: #fffbeb; }
.modal-doc-item.vencer     { border-color: #fed7aa; background: #fffbeb; }
.modal-doc-nombre { font-size: 13px; font-weight: 700; color: var(--texto); }
.modal-doc-fecha  { font-size: 11px; color: var(--texto-suave); margin-top: 2px; }

/* ── FORMULARIO NUEVO USUARIO ── */
.nuevo-usuario-form {
  background: white;
  border-radius: var(--radio-xl);
  padding: 32px 36px;
  box-shadow: var(--sombra-sm);
  max-width: 640px;
}
.nuevo-usuario-form h3 {
  font-family: 'Nunito', sans-serif;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}
.nuevo-usuario-form p { font-size: 14px; color: var(--texto-suave); margin-bottom: 28px; }

/* ── PANEL VACÍO ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--texto-suave);
}
.empty-state span { font-size: 48px; display: block; margin-bottom: 16px; }
.empty-state strong { display: block; font-size: 16px; font-weight: 700; margin-bottom: 8px; color: var(--texto); }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--texto);
  color: white;
  padding: 13px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 9999;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  display: flex; align-items: center; gap: 8px;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: #27ae60; }
.toast.error   { background: #e74c3c; }
.toast.warning { background: #f39c12; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-content { padding: 24px 20px 60px; }
  .admin-topbar  { padding: 0 20px; }
}
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .modal-docs-grid { grid-template-columns: 1fr; }
}
